FsCheck


GenExtensions

Namespace: FsCheck
Attributes:
[<AbstractClass>]
[<Sealed>]
[<Extension>]

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

Static members

Static memberDescription
GenExtensions.Apply(generator, f)
Signature: (generator:Gen<'?200921> * f:Gen<Func<'?200921,'?200922>>) -> Gen<'?200922>
Type parameters: '?200921, '?200922 Attributes:
[<Extension>]

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

GenExtensions.Array2DOf(generator)
Signature: generator:Gen<'?200919> -> Gen<'?200919 [,]>
Type parameters: '?200919 Attributes:
[<Extension>]

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

GenExtensions.Array2DOf(...)
Signature: (generator:Gen<'?200917> * rows:int * cols:int) -> Gen<'?200917 [,]>
Type parameters: '?200917 Attributes:
[<Extension>]

Generates a 2D array of the given dimensions.

GenExtensions.ArrayOf(generator)
Signature: generator:Gen<'?200915> -> Gen<'?200915 []>
Type parameters: '?200915 Attributes:
[<Extension>]

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

GenExtensions.ArrayOf(generator, length)
Signature: (generator:Gen<'?200913> * length:int) -> Gen<'?200913 []>
Type parameters: '?200913 Attributes:
[<Extension>]

Generates an array of a specified length.

GenExtensions.Cast(g)
Signature: g:Gen<'?200893> -> Gen<'?200893>
Type parameters: '?200893 Attributes:
[<Extension>]

Allows type annotations in LINQ expressions

GenExtensions.Eval(...)
Signature: (generator:Gen<'?200889> * size:int * random:StdGen) -> '?200889
Type parameters: '?200889 Attributes:
[<Extension>]

Generates a value with maximum size n.

GenExtensions.Four(generator)
Signature: generator:Gen<'?200934> -> Gen<'?200934 * '?200934 * '?200934 * '?200934>
Type parameters: '?200934 Attributes:
[<Extension>]

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

GenExtensions.ListOf(generator)
Signature: generator:Gen<'?200909> -> Gen<IList<'?200909>>
Type parameters: '?200909 Attributes:
[<Extension>]

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

GenExtensions.ListOf(...)
Signature: (generator:Gen<'?200907> * nbOfElements:int) -> Gen<IList<'?200907>>
Type parameters: '?200907 Attributes:
[<Extension>]

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

GenExtensions.NonEmptyListOf(generator)
Signature: generator:Gen<'a> -> Gen<IList<'a>>
Type parameters: 'a Attributes:
[<Extension>]

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

GenExtensions.Or(generator, other)
Signature: (generator:Gen<'?200952> * other:Gen<'?200952>) -> Gen<'?200952>
Type parameters: '?200952 Attributes:
[<Extension>]

Build a generator that generates a value from two generators with qual probability.

GenExtensions.OrNull(generator)
Signature: generator:Gen<'?200954> -> Gen<'?200954>
Type parameters: '?200954 Attributes:
[<Extension>]

Build a generator that generates a value or null

GenExtensions.Resize(generator, newSize)
Signature: (generator:Gen<'?200924> * newSize:int) -> Gen<'?200924>
Type parameters: '?200924 Attributes:
[<Extension>]

Override the current size of the test.

GenExtensions.Sample(...)
Signature: (generator:Gen<'?200891> * size:int * numberOfSamples:int) -> '?200891 list
Type parameters: '?200891 Attributes:
[<Extension>]

Generates n values of the given size.

GenExtensions.Select(g, selector)
Signature: (g:Gen<'?200895> * selector:Func<'?200895,'?200896>) -> Gen<'?200896>
Type parameters: '?200895, '?200896 Attributes:
[<Extension>]

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

GenExtensions.SelectMany(...)
Signature: (source:Gen<'?200903> * f:Func<'?200903,Gen<'?200904>> * select:Func<'?200903,'?200904,'?200905>) -> Gen<'?200905>
Type parameters: '?200903, '?200904, '?200905 Attributes:
[<Extension>]
GenExtensions.SelectMany(source, f)
Signature: (source:Gen<'?200900> * f:Func<'?200900,Gen<'?200901>>) -> Gen<'?200901>
Type parameters: '?200900, '?200901 Attributes:
[<Extension>]
GenExtensions.Three(generator)
Signature: generator:Gen<'?200932> -> Gen<'?200932 * '?200932 * '?200932>
Type parameters: '?200932 Attributes:
[<Extension>]

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

GenExtensions.ToArbitrary(...)
Signature: (generator:Gen<'?200928> * shrinker:('?200928 -> seq<'?200928>)) -> Arbitrary<'?200928>
Type parameters: '?200928 Attributes:
[<Extension>]

Construct an Arbitrary instance from a generator and a shrinker.

GenExtensions.ToArbitrary(generator)
Signature: generator:Gen<'?200926> -> Arbitrary<'?200926>
Type parameters: '?200926 Attributes:
[<Extension>]

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

GenExtensions.Two(generator)
Signature: generator:Gen<'?200930> -> Gen<'?200930 * '?200930>
Type parameters: '?200930 Attributes:
[<Extension>]

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

GenExtensions.Where(g, predicate)
Signature: (g:Gen<'?200898> * predicate:Func<'?200898,bool>) -> Gen<'?200898>
Type parameters: '?200898 Attributes:
[<Extension>]

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.

GenExtensions.Zip(...)
Signature: (generator:Gen<'?200947> * second:Gen<'?200948> * third:Gen<'?200949> * resultSelector:Func<'?200947,'?200948,'?200949,'?200950>) -> Gen<'?200950>
Type parameters: '?200947, '?200948, '?200949, '?200950 Attributes:
[<Extension>]

Combine two generators into a new generator of the result of the given result selector.

GenExtensions.Zip(...)
Signature: (generator:Gen<'?200943> * second:Gen<'?200944> * third:Gen<'?200945>) -> Gen<'?200943 * '?200944 * '?200945>
Type parameters: '?200943, '?200944, '?200945 Attributes:
[<Extension>]

Combine two generators into a generator of 3-tuples.

GenExtensions.Zip(...)
Signature: (generator:Gen<'?200939> * other:Gen<'?200940> * resultSelector:Func<'?200939,'?200940,'?200941>) -> Gen<'?200941>
Type parameters: '?200939, '?200940, '?200941 Attributes:
[<Extension>]

Combine two generators into a new generator of the result of the given result selector.

GenExtensions.Zip(generator, other)
Signature: (generator:Gen<'?200936> * other:Gen<'?200937>) -> Gen<'?200936 * '?200937>
Type parameters: '?200936, '?200937 Attributes:
[<Extension>]

Combine two generators into a generator of pairs.

Fork me on GitHub