Sha256: 7628bca24934868e3341a7ed2bb10fa8767dfa9129ee9815d6f16f57c673a27b

Contents?: true

Size: 1.8 KB

Versions: 78

Compression:

Stored size: 1.8 KB

Contents

// This file was auto-generated based on version 1.1.0 of the canonical data.

module LuhnTest

open FsUnit.Xunit
open Xunit

open Luhn

[<Fact>]
let ``Single digit strings can not be valid`` () =
    valid "1" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``A single zero is invalid`` () =
    valid "0" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``A simple valid SIN that remains valid if reversed`` () =
    valid "059" |> should equal true

[<Fact(Skip = "Remove to run test")>]
let ``A simple valid SIN that becomes invalid if reversed`` () =
    valid "59" |> should equal true

[<Fact(Skip = "Remove to run test")>]
let ``A valid Canadian SIN`` () =
    valid "055 444 285" |> should equal true

[<Fact(Skip = "Remove to run test")>]
let ``Invalid Canadian SIN`` () =
    valid "055 444 286" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``Invalid credit card`` () =
    valid "8273 1232 7352 0569" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``Valid strings with a non-digit included become invalid`` () =
    valid "055a 444 285" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``Valid strings with punctuation included become invalid`` () =
    valid "055-444-285" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``Valid strings with symbols included become invalid`` () =
    valid "055£ 444$ 285" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``Single zero with space is invalid`` () =
    valid " 0" |> should equal false

[<Fact(Skip = "Remove to run test")>]
let ``More than a single zero is valid`` () =
    valid "0000 0" |> should equal true

[<Fact(Skip = "Remove to run test")>]
let ``Input digit 9 is correctly converted to output digit 9`` () =
    valid "091" |> should equal true

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
trackler-2.2.1.127 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.126 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.125 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.124 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.123 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.122 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.121 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.120 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.119 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.118 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.117 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.116 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.115 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.114 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.113 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.111 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.110 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.109 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.108 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.107 tracks/fsharp/exercises/luhn/LuhnTest.fs