FsCheck


GenExtensions

Namespace: FsCheck

Extension methods to build generators - contains among other the Linq methods.

Static members

Static memberDescription
Apply(generator, f)
Signature: (generator:Gen<'?209376> * f:Gen<Func<'?209376,'?209377>>) -> Gen<'?209377>
Type parameters: '?209376, '?209377

Apply the given Gen function to this generator, aka the applicative <*> operator.

Array2DOf(generator)
Signature: generator:Gen<'?209374> -> Gen<'?209374 [,]>
Type parameters: '?209374

Generates a 2D array. The square root of the size is the maximum number of rows and columns.

Array2DOf(generator, rows, cols)
Signature: (generator:Gen<'?209372> * rows:int * cols:int) -> Gen<'?209372 [,]>
Type parameters: '?209372

Generates a 2D array of the given dimensions.

ArrayOf(generator)
Signature: generator:Gen<'?209370> -> Gen<'?209370 []>
Type parameters: '?209370

Generates an array using the specified generator. The maximum length is size+1.

ArrayOf(generator, length)
Signature: (generator:Gen<'?209368> * length:int) -> Gen<'?209368 []>
Type parameters: '?209368

Generates an array of a specified length.

Cast(g)
Signature: g:Gen<'?209348> -> Gen<'?209348>
Type parameters: '?209348

Allows type annotations in LINQ expressions

Eval(generator, size, random)
Signature: (generator:Gen<'?209344> * size:int * random:StdGen) -> '?209344
Type parameters: '?209344

Generates a value with maximum size n.

Four(generator)
Signature: generator:Gen<'?209389> -> Gen<'?209389 * '?209389 * '?209389 * '?209389>
Type parameters: '?209389

Build a generator that generates a 4-tuple of the values generated by the given generator.

ListOf(generator)
Signature: generator:Gen<'?209364> -> Gen<IList<'?209364>>
Type parameters: '?209364

Generates a list of random length. The maximum length depends on the size parameter.

ListOf(generator, nbOfElements)
Signature: (generator:Gen<'?209362> * nbOfElements:int) -> Gen<IList<'?209362>>
Type parameters: '?209362

Generates a list of given length, containing values generated by the given generator.

NonEmptyListOf(generator)
Signature: generator:Gen<'a> -> Gen<IList<'a>>
Type parameters: 'a

Generates a non-empty list of random length. The maximum length depends on the size parameter.

Resize(generator, newSize)
Signature: (generator:Gen<'?209379> * newSize:int) -> Gen<'?209379>
Type parameters: '?209379

Override the current size of the test.

Sample(generator, size, numberOfSamples)
Signature: (generator:Gen<'?209346> * size:int * numberOfSamples:int) -> '?209346 list
Type parameters: '?209346

Generates n values of the given size.

Select(g, selector)
Signature: (g:Gen<'?209350> * selector:Func<'?209350,'?209351>) -> Gen<'?209351>
Type parameters: '?209350, '?209351

Map the given function to the value in the generator, yielding a new generator of the result type.

SelectMany(source, f, select)
Signature: (source:Gen<'?209358> * f:Func<'?209358,Gen<'?209359>> * select:Func<'?209358,'?209359,'?209360>) -> Gen<'?209360>
Type parameters: '?209358, '?209359, '?209360
SelectMany(source, f)
Signature: (source:Gen<'?209355> * f:Func<'?209355,Gen<'?209356>>) -> Gen<'?209356>
Type parameters: '?209355, '?209356
Three(generator)
Signature: generator:Gen<'?209387> -> Gen<'?209387 * '?209387 * '?209387>
Type parameters: '?209387

Build a generator that generates a 3-tuple of the values generated by the given generator.

ToArbitrary(generator, shrinker)
Signature: (generator:Gen<'?209383> * shrinker:('?209383 -> seq<'?209383>)) -> Arbitrary<'?209383>
Type parameters: '?209383

Construct an Arbitrary instance from a generator and a shrinker.

ToArbitrary(generator)
Signature: generator:Gen<'?209381> -> Arbitrary<'?209381>
Type parameters: '?209381

Construct an Arbitrary instance from a generator. Shrink is not supported for this type.

Two(generator)
Signature: generator:Gen<'?209385> -> Gen<'?209385 * '?209385>
Type parameters: '?209385

Build a generator that generates a 2-tuple of the values generated by the given generator.

Where(g, predicate)
Signature: (g:Gen<'?209353> * predicate:Func<'?209353,bool>) -> Gen<'?209353>
Type parameters: '?209353

Generates a value that satisfies a predicate. This function keeps re-trying by increasing the size of the original generator ad infinitum. Make sure there is a high chance that the predicate is satisfied.

Fork me on GitHub