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.106 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.105 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.104 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.103 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.102 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.101 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.100 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.99 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.98 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.97 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.96 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.95 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.94 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.93 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.92 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.91 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.90 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.89 tracks/fsharp/exercises/luhn/LuhnTest.fs