Split into lib (#16)

This commit is contained in:
Patrick Stevens
2024-06-05 00:42:53 +01:00
committed by GitHub
parent 247cc9fa0d
commit 48e111fc9e
12 changed files with 550 additions and 472 deletions

View File

@@ -14,6 +14,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="TestAppDomain.fs" />
<Compile Include="TestCaseData.fs" />
</ItemGroup>
<ItemGroup>

23
Consumer/TestCaseData.fs Normal file
View File

@@ -0,0 +1,23 @@
namespace Consumer
open FsUnitTyped
open NUnit.Framework
[<TestFixture>]
module TestCaseData =
let testCasesSeen = ResizeArray ()
let dataSourceRaw = [ 3, "hi", [| 4.0 |] ; -10, "bye", null ]
[<OneTimeTearDown>]
let tearDown () =
testCasesSeen
|> Seq.toList
|> List.sortBy (fun (a, _, _) -> a)
|> shouldEqual (dataSourceRaw |> List.sortBy (fun (a, _, _) -> a))
let dataSource = dataSourceRaw |> List.map TestCaseData
[<TestCaseSource(nameof dataSource)>]
let ``Consume test data`` (i : int, s : string, arr : float[]) =
lock testCasesSeen (fun () -> testCasesSeen.Add (i, s, arr))