namespace Consumer open FsUnitTyped open NUnit.Framework [] module TestValues = let seen1 = ResizeArray () [] let ``Can consume values, single boolean`` ([] x : bool) : unit = lock seen1 (fun () -> seen1.Add x) let seen2 = ResizeArray () [] let ``Can consume values, two bools, sequential, lengths match`` ([] x : bool, [] y) : unit = lock seen2 (fun () -> seen2.Add (x, y)) let seen3 = ResizeArray () [] let ``Can consume values, two ints, sequential, lengths don't match, value type`` ([] x : int, [] y : int) : unit = lock seen3 (fun () -> seen3.Add (x, box y)) let seen4 = ResizeArray () [] let ``Can consume values, two strings, sequential, lengths don't match, reference type`` ([] x : string, [] y : string) : unit = lock seen4 (fun () -> seen4.Add (x, box y)) let seen5 = ResizeArray () [] let ``Can consume values, two ints, combinatorial, lengths don't match, value type`` ([] x : int, [] y : int) : unit = lock seen5 (fun () -> seen5.Add (x, box y)) let seen6 = ResizeArray () [] let ``Can consume values, two strings, combinatorial, lengths don't match, reference type`` ([] x : string, [] y : string) : unit = lock seen6 (fun () -> seen6.Add (x, box y)) let seen7 = ResizeArray () [] let ``Can consume values, two ints, implicit combinatorial, lengths don't match, value type`` ([] x : int, [] y : int) : unit = lock seen7 (fun () -> seen7.Add (x, box y)) let seen8 = ResizeArray () [] let ``Can consume values, two strings, implicit combinatorial, lengths don't match, reference type`` ([] x : string, [] y : string) : unit = lock seen8 (fun () -> seen8.Add (x, box y)) let seen9 = ResizeArray () [] let ``Can consume values, two strings, implicit combinatorial, reference type`` ([] x : string, [] y : string) : unit = lock seen9 (fun () -> seen9.Add (x, y)) [] let ``Values are all OK`` () = seen1 |> Seq.toList |> List.sort |> shouldEqual [ false ; true ] seen2 |> Seq.toList |> List.sort |> shouldEqual [ (false, true) ; (true, false) ] seen3 |> Seq.toList |> List.sortBy fst |> shouldEqual [ (31, box 0) ; (88, box 29) ] seen4 |> Seq.toList |> List.sortBy fst |> shouldEqual [ ("bye", null) ; ("hi", box "ohh") ] seen5 |> Seq.toList |> List.sortBy fst |> shouldEqual [ (31, box 29) ; (88, box 29) ] seen6 |> Seq.toList |> List.sortBy fst |> shouldEqual [ ("bye", box "ohh") ; ("hi", box "ohh") ] seen7 |> Seq.toList |> List.sortBy fst |> shouldEqual [ (31, box 29) ; (88, box 29) ] seen8 |> Seq.toList |> List.sortBy fst |> shouldEqual [ ("bye", box "ohh") ; ("hi", box "ohh") ] seen9 |> Seq.toList |> List.sort |> shouldEqual ( List.sort [ ("hi", "x1") ("bye", "x1") ("whoa", "x1") ("hi", "x2") ("bye", "x2") ("whoa", "x2") ] )