FsCheck


Prop Module

Namespace: FsCheck

Assembly: FsCheck.dll

Combinators to build properties, which define the property to be tested, with some convenience methods to investigate the generated arguments and any found counter-examples.

Functions and values

Function or value Description

classify b name

Full Usage: classify b name

Parameters:
    b : bool
    name : string

Returns: 'Testable -> Property

Classify test cases. Test cases satisfying the condition are assigned the classification given.

b : bool
name : string
Returns: 'Testable -> Property

collect v

Full Usage: collect v

Parameters:
    v : 'CollectedValue

Returns: 'Testable -> Property

Collect data values. The argument of collect is evaluated in each test case, and the distribution of values is reported, using sprintf "%A".

v : 'CollectedValue
Returns: 'Testable -> Property

discard ()

Full Usage: discard ()

Parameters:
    () : unit

Returns: 'a

() : unit
Returns: 'a

filter condition assertion

Full Usage: filter condition assertion

Parameters:
    condition : bool
    assertion : 'Testable

Returns: Property

Conditional property combinator. Resulting property holds if the given property holds whenever the condition does. See also operator: 'assertion ==> property'

condition : bool
assertion : 'Testable
Returns: Property

filterAction condition assertion

Full Usage: filterAction condition assertion

Parameters:
    condition : bool
    assertion : Action

Returns: Property

Conditional property combinator. Resulting property holds if the given property holds whenever the condition does. See also operator: 'assertion ==> property'

condition : bool
assertion : Action
Returns: Property

filterFunc condition assertion

Full Usage: filterFunc condition assertion

Parameters:
    condition : bool
    assertion : Func<'Testable>

Returns: Property

Conditional property combinator. Resulting property holds if the given property holds whenever the condition does. See also operator: 'assertion ==> property'

condition : bool
assertion : Func<'Testable>
Returns: Property

forAll arb body

Full Usage: forAll arb body

Parameters:
    arb : Arbitrary<'Value>
    body : 'Value -> 'Testable

Returns: Property

Quantified property combinator. Provide a custom test data generator to a property.

arb : Arbitrary<'Value>
body : 'Value -> 'Testable
Returns: Property

forAllAction1 arb body

Full Usage: forAllAction1 arb body

Parameters:
Returns: Property

arb : Arbitrary<'Value>
body : Action<'Value>
Returns: Property

forAllAction1Def body

Full Usage: forAllAction1Def body

Parameters:
Returns: Property

body : Action<'Value>
Returns: Property

forAllAction2 (arb1, arb2) body

Full Usage: forAllAction2 (arb1, arb2) body

Parameters:
Returns: Property

arb1 : Arbitrary<'V1>
arb2 : Arbitrary<'V2>
body : Action<'V1, 'V2>
Returns: Property

forAllAction2Def body

Full Usage: forAllAction2Def body

Parameters:
Returns: Property

body : Action<'V1, 'V2>
Returns: Property

forAllAction3 (arb1, arb2, arb3) body

Full Usage: forAllAction3 (arb1, arb2, arb3) body

Parameters:
Returns: Property

arb1 : Arbitrary<'V1>
arb2 : Arbitrary<'V2>
arb3 : Arbitrary<'V3>
body : Action<'V1, 'V2, 'V3>
Returns: Property

forAllAction3Def body

Full Usage: forAllAction3Def body

Parameters:
    body : Action<'V1, 'V2, 'V3>

Returns: Property

body : Action<'V1, 'V2, 'V3>
Returns: Property

forAllFunc1Bool arb body

Full Usage: forAllFunc1Bool arb body

Parameters:
Returns: Property

arb : Arbitrary<'Value>
body : Func<'Value, bool>
Returns: Property

forAllFunc1BoolDef body

Full Usage: forAllFunc1BoolDef body

Parameters:
    body : Func<'Value, bool>

Returns: Property

body : Func<'Value, bool>
Returns: Property

forAllFunc1Prop arb body

Full Usage: forAllFunc1Prop arb body

Parameters:
Returns: Property

arb : Arbitrary<'Value>
body : Func<'Value, Property>
Returns: Property

forAllFunc1PropDef body

Full Usage: forAllFunc1PropDef body

Parameters:
Returns: Property

body : Func<'Value, Property>
Returns: Property

forAllFunc2Bool (arb1, arb2) body

Full Usage: forAllFunc2Bool (arb1, arb2) body

Parameters:
Returns: Property

arb1 : Arbitrary<'V1>
arb2 : Arbitrary<'V2>
body : Func<'V1, 'V2, bool>
Returns: Property

forAllFunc2BoolDef body

Full Usage: forAllFunc2BoolDef body

Parameters:
    body : Func<'V1, 'V2, bool>

Returns: Property

body : Func<'V1, 'V2, bool>
Returns: Property

forAllFunc2Prop (arb1, arb2) body

Full Usage: forAllFunc2Prop (arb1, arb2) body

Parameters:
Returns: Property

arb1 : Arbitrary<'V1>
arb2 : Arbitrary<'V2>
body : Func<'V1, 'V2, Property>
Returns: Property

forAllFunc2PropDef body

Full Usage: forAllFunc2PropDef body

Parameters:
Returns: Property

body : Func<'V1, 'V2, Property>
Returns: Property

forAllFunc3Bool (arb1, arb2, arb3) body

Full Usage: forAllFunc3Bool (arb1, arb2, arb3) body

Parameters:
Returns: Property

arb1 : Arbitrary<'V1>
arb2 : Arbitrary<'V2>
arb3 : Arbitrary<'V3>
body : Func<'V1, 'V2, 'V3, bool>
Returns: Property

forAllFunc3BoolDef body

Full Usage: forAllFunc3BoolDef body

Parameters:
    body : Func<'V1, 'V2, 'V3, bool>

Returns: Property

body : Func<'V1, 'V2, 'V3, bool>
Returns: Property

forAllFunc3Prop (arb1, arb2, arb3) body

Full Usage: forAllFunc3Prop (arb1, arb2, arb3) body

Parameters:
Returns: Property

arb1 : Arbitrary<'V1>
arb2 : Arbitrary<'V2>
arb3 : Arbitrary<'V3>
body : Func<'V1, 'V2, 'V3, Property>
Returns: Property

forAllFunc3PropDef body

Full Usage: forAllFunc3PropDef body

Parameters:
Returns: Property

body : Func<'V1, 'V2, 'V3, Property>
Returns: Property

given condition (iftrue, ifFalse)

Full Usage: given condition (iftrue, ifFalse)

Parameters:
    condition : bool
    iftrue : 'TestableIfTrue
    ifFalse : 'TestableIfFalse

Returns: Property

Depending on the condition, return the first testable if true and the second if false.

condition : bool
iftrue : 'TestableIfTrue
ifFalse : 'TestableIfFalse
Returns: Property

label l

Full Usage: label l

Parameters:
    l : string

Returns: 'Testable -> Property

Add the given label to the property. The labels of a failing sub-property are displayed when it fails.

l : string
Returns: 'Testable -> Property

ofTestable testable

Full Usage: ofTestable testable

Parameters:
    testable : 'Testable

Returns: Property

Turns a testable type into a property. Testables are unit, boolean, Lazy testables, Gen testables, functions from a type for which a generator is know to a testable, tuples up to 6 tuple containing testables, and lists containing testables.

testable : 'Testable
Returns: Property

throws p

Full Usage: throws p

Parameters:
    p : Lazy<'Testable>

Returns: Property

Expect exception 't when executing p. So, results in success if an exception of the given type is thrown, and a failure otherwise.

p : Lazy<'Testable>
Returns: Property

trivial b

Full Usage: trivial b

Parameters:
    b : bool

Returns: 'Testable -> Property

Count trivial cases. Test cases for which the condition is True are classified as trivial.

b : bool
Returns: 'Testable -> Property

within time lazyProperty

Full Usage: within time lazyProperty

Parameters:
    time : int
    lazyProperty : Lazy<'Testable>

Returns: Property

Fails the property if it does not complete within t milliseconds. Note that the called property gets a cancel signal, but whether it responds to that is up to the property; the execution may not actually stop.

time : int
lazyProperty : Lazy<'Testable>
Returns: Property