Fix treatment of optionals which are not in TestCaseData (#49)

This commit is contained in:
Patrick Stevens
2024-06-09 12:24:58 +01:00
committed by GitHub
parent 8dc23d5b38
commit b600fab887
3 changed files with 10 additions and 3 deletions

View File

@@ -25,10 +25,15 @@ module TestCaseData =
let ``Consume test data from multiple sources`` (i : int, s : string, arr : float[]) =
lock multipleSources (fun () -> multipleSources.Add (i, s, arr))
let optional = [ Some "hi" ; None ] |> List.map TestCaseData
let optionalData = [ Some "hi" ; None ] |> List.map TestCaseData
[<TestCaseSource(nameof optional)>]
let ``Consume options`` (s : string option) : unit = s |> shouldEqual s
[<TestCaseSource(nameof optionalData)>]
let ``Consume options, TestCaseData`` (s : string option) : unit = s |> shouldEqual s
let optionalRaw = [ Some "hi" ; None ]
[<TestCaseSource(nameof optionalRaw)>]
let ``Consume options, raw`` (s : string option) : unit = s |> shouldEqual s
[<OneTimeTearDown>]
let tearDown () =