Class ValueObjectArbitrary
Namespace: AdCodicem.ValueObjects.FsCheck
Assembly: AdCodicem.ValueObjects.FsCheck.dll
The FsCheck arbitrary of a value object: values its rules accept, drawn from the schema it declares, biased towards the edges it declares, and shrinking to values it accepts.
public static class ValueObjectArbitrary
Inheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
FsCheck draws the seed of each value, which seeds the
A counterexample shrinks through
Nothing of the value object is read before the first draw: neither its schema nor its type initializer runs when the arbitrary is built or merged.
Methods
For<TSelf, TValue>(ValueObjectSamplerOptions?)
Gets the arbitrary of a value object: values its rules accept, one in four at its boundaries, shrunk to values it accepts.
public static Arbitrary<TSelf> For<TSelf, TValue>(ValueObjectSamplerOptions? options = null) where TSelf : struct, IValueObject<TSelf, TValue>
Parameters
options ValueObjectSamplerOptions?
How each value is drawn, the generators of the rules no schema carries included, or null for the defaults.
Returns
Arbitrary<TSelf>
The arbitrary, to merge into a map with MergeArb or to hand to Prop.ForAll.
Type Parameters
TSelf
The value object.
TValue
Its underlying type.
Remarks
A draw that finds no value the type accepts throws a