Sha256: df484c3af094c941dec81fab3073c925319a8cf22c13b996bf96fc420eebaed3

Contents?: true

Size: 776 Bytes

Versions: 27

Compression:

Stored size: 776 Bytes

Contents

module LuhnTest

open NUnit.Framework
open Luhn
  
[<TestCase("1", ExpectedResult = false)>] // single digit strings can not be valid
[<TestCase("0", ExpectedResult = false, Ignore = "Remove to run test case")>] // a single zero is invalid
[<TestCase("046 454 286", ExpectedResult = true, Ignore = "Remove to run test case")>] // valid Canadian SIN
[<TestCase("046 454 287", ExpectedResult = false, Ignore = "Remove to run test case")>] // invalid Canadian SIN
[<TestCase("8273 1232 7352 0569", ExpectedResult = false, Ignore = "Remove to run test case")>] // invalid credit card
[<TestCase("827a 1232 7352 0569", ExpectedResult = false, Ignore = "Remove to run test case")>] // strings that contain non-digits are not valid
let ``Validate checksum`` number =
    valid number

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
trackler-2.0.6.16 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.0.6.15 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.0.6.14 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.0.6.13 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.0.6.12 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.0.6.11 tracks/fsharp/exercises/luhn/LuhnTest.fs
trackler-2.0.6.10 tracks/fsharp/exercises/luhn/LuhnTest.fs