Sha256: fceaea4212190633411346a3ea6b19b08389349440fab5e5edc0418fdd5550d6

Contents?: true

Size: 1.8 KB

Versions: 44

Compression:

Stored size: 1.8 KB

Contents

// This file was auto-generated based on version 1.0.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

44 entries across 44 versions & 1 rubygems

Version Path
trackler-2.2.1.88 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.87 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.86 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.85 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.84 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.83 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.82 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.81 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.80 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.79 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.78 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.77 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.76 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.75 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.74 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.73 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.72 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.71 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.70 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.69 tracks/fsharp/exercises/luhn/LuhnTest.fs