At first I tried to create a generator in which the first 5 elements were fixed (and in any test using the Prop.forAllfirst five will always be executed), but I could not do this.
Now I'm trying to simplify this by having one generator for random data within the range and one generator for non-random data, i.e. fixed sequence. It is similar to Gen.constant, except that instead of a single value, it is a sequence of values.
I have this (simplified reproducible example, works with NUnit and xUnit):
[<Property(Verbose = true, MaxTest=5)>]
static member MultiplyIdentityCornerCases () =
Gen.elements [0L; -1L; 1L; Int64.MinValue; Int64.MaxValue]
|> Arb.fromGen
|> Prop.forAll <| fun x -> x = x * 1L
Exit (I don’t know where it comes from null):
0:
<null>
9223372036854775807L
1:
<null>
-9223372036854775807L
2:
<null>
-9223372036854775807L
3:
<null>
1L
4:
<null>
-9223372036854775807L
Ok, passed 5 tests.
, , , , . , NUnit ( ) testdata, , FsCheck ( , , ).
, FsCheck , , , , , . FsCheck, testdata.