|
Generates one-dimensional arrays.
The length of the generated array is between 0 and size.
The sum of the sizes of the elements is equal to the size of the generated array.
-
elements
:
Arbitrary<'T>
-
Returns:
Arbitrary<'T[]>
|
|
Construct an Arbitrary instance for a type that can be mapped to and from another type (e.g. a wrapper),
based on a Arbitrary instance for the source type and two mapping functions.
-
convertTo
:
'T -> 'U
-
convertFrom
:
'U -> 'T
-
a
:
Arbitrary<'T>
-
Returns:
Arbitrary<'U>
|
|
Return an Arbitrary instance that is a filtered version of an existing arbitrary instance.
The generator uses Gen.where, and the shrinks are filtered using Seq.filter with the given predicate.
-
pred
:
'T -> bool
-
a
:
Arbitrary<'T>
-
Returns:
Arbitrary<'T>
|
|
Construct an Arbitrary instance from a generator.
Shrink is not supported for this type.
-
gen
:
Gen<'Value>
-
Returns:
Arbitrary<'Value>
|
|
Construct an Arbitrary instance from a generator and shrinker.
-
gen
:
Gen<'Value>
-
shrinker
:
'Value -> seq<'Value>
-
Returns:
Arbitrary<'Value>
|
|
Generates FSharp.Core list<'T> values.
The length of the generated list is between 0 and size.
The sum of the sizes of the elements is equal to the size of the generated list.
-
elements
:
Arbitrary<'T>
-
Returns:
Arbitrary<'T list>
|
|
Return an Arbitrary instance that is a mapped and filtered version of an existing arbitrary instance.
The generator uses Gen.map with the given mapper and then Gen.where with the given predicate,
and the shrinks are filtered using Seq.filter with the given predicate.
This is sometimes useful if using just a filter would reduce the chance of getting a good value
from the generator - and you can map the value instead. E.g. PositiveInt.
-
mapper
:
'T -> 'T
-
pred
:
'T -> bool
-
a
:
Arbitrary<'T>
-
Returns:
Arbitrary<'T>
|
|
Generates Map values.
Not named `map` because that has other meanings.
-
keys
:
Arbitrary<'TKey>
-
values
:
Arbitrary<'TValue>
-
Returns:
Arbitrary<Map<'TKey, 'TValue>>
|
|
Generates nullable values that are null 1/8 of the time.
-
value
:
Arbitrary<'T>
-
Returns:
Arbitrary<Nullable<'T>>
|
|
Generates option values that are None 1/8 of the time.
-
value
:
Arbitrary<'T>
-
Returns:
Arbitrary<'T option>
|
|
Generates pure functions that produce the given output values 'U.
There is no shrinking for functions.
-
target
:
Arbitrary<'U>
-
Returns:
Arbitrary<('T -> 'U)>
|
|
Generates Set<'T> values.
-
elements
:
Arbitrary<'T>
-
Returns:
Arbitrary<Set<'T>>
|
|
Generates F# function values that generate an instance of the function result type about half the time. The other
times it generate one of the given exceptions.
-
exceptions
:
seq<Exception>
-
target
:
Arbitrary<'U>
-
Returns:
Arbitrary<('T -> 'U)>
|
|
Get the Gen from the given Arbitary.
-
arb
:
Arbitrary<'Value>
-
Returns:
Gen<'Value>
|
|
Get the shrinker function from the given Arbitrary.
-
arb
:
Arbitrary<'Value>
-
Returns:
'Value -> seq<'Value>
|
|
Generates 2-tuples.
-
t1
:
Arbitrary<'T1>
-
t2
:
Arbitrary<'T2>
-
Returns:
Arbitrary<'T1 * 'T2>
|