mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-10-05 09:28:40 +00:00
Split into lib (#16)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Compile Include="TestAppDomain.fs" />
|
||||
<Compile Include="TestCaseData.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
23
Consumer/TestCaseData.fs
Normal file
23
Consumer/TestCaseData.fs
Normal 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))
|
Reference in New Issue
Block a user