mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-10-07 02:08:40 +00:00
Support [<Values>]
(#12)
This commit is contained in:
32
TestRunner/TestRunner.Test/TestList.fs
Normal file
32
TestRunner/TestRunner.Test/TestList.fs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace TestRunner.Test
|
||||
|
||||
open FsCheck
|
||||
open FsUnitTyped
|
||||
open TestRunner
|
||||
open NUnit.Framework
|
||||
|
||||
[<TestFixture>]
|
||||
module TestList =
|
||||
|
||||
[<Test>]
|
||||
let ``combinations has right size`` () =
|
||||
let property (xs : int list list) =
|
||||
let combs = List.combinations xs
|
||||
|
||||
combs.Length
|
||||
|> shouldEqual ((1, xs) ||> List.fold (fun acc l -> acc * l.Length))
|
||||
|
||||
Check.QuickThrowOnFailure property
|
||||
|
||||
[<Test>]
|
||||
let ``each combination is drawn from the right set`` () =
|
||||
let property (xs : int list list) =
|
||||
let combs = List.combinations xs
|
||||
|
||||
for comb in combs do
|
||||
comb.Length |> shouldEqual xs.Length
|
||||
|
||||
for i = 0 to comb.Length - 1 do
|
||||
xs.[i] |> shouldContain comb.[i]
|
||||
|
||||
Check.QuickThrowOnFailure property
|
@@ -9,9 +9,11 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="TestFilter.fs" />
|
||||
<Compile Include="TestList.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FsCheck" Version="3.0.0-rc3" />
|
||||
<PackageReference Include="FsUnit" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="NUnit" Version="4.1.0" />
|
||||
|
Reference in New Issue
Block a user