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.167 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.166 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.165 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.164 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.163 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.162 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.161 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.160 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.159 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.158 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.157 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.156 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.155 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.154 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.153 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.152 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.151 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.150 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.149 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.2.1.148 tracks/fsharp/exercises/luhn/LuhnTest.fs