mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-10-07 10:18:38 +00:00
Fix treatment of optionals which are not in TestCaseData (#49)
This commit is contained in:
1
.github/workflows/dotnet.yaml
vendored
1
.github/workflows/dotnet.yaml
vendored
@@ -74,6 +74,7 @@ jobs:
|
||||
run: 'nix develop --command dotnet exec ./TestRunner/bin/Release/net8.0/TestRunner.dll ./Consumer/bin/Release/net8.0/Consumer.dll --trx TrxOut/out.trx'
|
||||
- name: Parse Trx files
|
||||
uses: NasAmin/trx-parser@v0.6.0
|
||||
if: always()
|
||||
id: trx-parser
|
||||
with:
|
||||
TRX_PATH: ${{ github.workspace }}/TrxOut
|
||||
|
@@ -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 () =
|
||||
|
@@ -332,6 +332,7 @@ module TestFixture =
|
||||
yield
|
||||
Guid.NewGuid (),
|
||||
match arg with
|
||||
| null -> [| (null : obj) |]
|
||||
| :? Tuple<obj, obj> as (a, b) -> [| a ; b |]
|
||||
| :? Tuple<obj, obj, obj> as (a, b, c) -> [| a ; b ; c |]
|
||||
| :? Tuple<obj, obj, obj, obj> as (a, b, c, d) -> [| a ; b ; c ; d |]
|
||||
|
Reference in New Issue
Block a user