CsCheck/Check.cs
/// <summary>Sample model-based operations on a random initial state checking that actual and model are equal.
/// If not the failing initial state and sequence will be shrunk down to the shortest and simplest.</summary>
/// <param name="initial">The initial state generator.</param>
/// <param name="operation1">An operation generator that can act on the state.</param>
/// <param name="operation2">An operation generator that can act on the state.</param>
/// <param name="equal">A function to check if the actual and model are the same (default Check.ModelEqual).</param>
/// <param name="seed">The initial seed to use for the first iteration.</param>
/// <param name="iter">The number of iterations to run in the sample (default 100).</param>
/// <param name="time">The number of seconds to run the sample.</param>
/// <param name="threads">The number of threads to run the sample on (default number logical CPUs).</param>
/// <param name="printActual">A function to convert the actual state to a string for error reporting (default Check.Print).</param>
/// <param name="printModel">A function to convert the model state to a string for error reporting (default Check.Print).</param>
Sample model-based operations on a random initial state checking that actual and model are equal.
If not the failing initial state and sequence will be shrunk down to the shortest and simplest.
Sample model - based operations on a random initial state checking that actual and model are equal . If not the failing initial state and sequence will be shrunk down to the shortest and simplest .
public static void SampleModelBased<Actual, Model>(this Gen<(Actual, Model)> initial, GenOperation<Actual, Model> operation1,
            GenOperation<Actual, Model> operation2,
            Func<Actual, Model, bool> equal = null, string seed = null, long iter = -1, int time = -1, int threads = -1,
            Func<Actual, string> printActual = null, Func<Model, string> printModel = null)
            => SampleModelBased(initial, new[] { operation1, operation2 }, equal, seed, iter, time, threads, printActual, printModel);
public static void SampleModelBased < Actual , Model > ( this Gen < ( Actual , Model ) > initial , GenOperation < Actual , Model > operation1 , GenOperation < Actual , Model > operation2 , Func < Actual , Model , bool > equal = null , string seed = null , long iter = - 1 , int time = - 1 , int threads = - 1 , Func < Actual , string > printActual = null , Func < Model , string > printModel = null ) => SampleModelBased ( initial , new [ ] { operation1 , operation2 } , equal , seed , iter , time , threads , printActual , printModel ) ;
Sample model-based operations on a random initial state checking that actual and model are equal.
Sample model - based operations on a random initial state checking that actual and model are equal .
Gen<(Actual, Model)>
this
operation1
GenOperation<Actual, Model>
An operation generator that can act on the state.
An operation generator that can act on the state .
operation2
GenOperation<Actual, Model>
An operation generator that can act on the state.
An operation generator that can act on the state .
equal
Func<Actual, Model, bool>
A function to check if the actual and model are the same (default Check.ModelEqual).
A function to check if the actual and model are the same ( default Check . ModelEqual ) .
seed
string
The initial seed to use for the first iteration.
The initial seed to use for the first iteration .
iter
long
The number of iterations to run in the sample (default 100).
The number of iterations to run in the sample ( default 100 ) .
time
int
The number of seconds to run the sample.
The number of seconds to run the sample .
threads
int
The number of threads to run the sample on (default number logical CPUs).
The number of threads to run the sample on ( default number logical CPUs ) .
printActual
Func<Actual, string>
A function to convert the actual state to a string for error reporting (default Check.Print).
A function to convert the actual state to a string for error reporting ( default Check . Print ) .
printModel
Func<Model, string>
A function to convert the model state to a string for error reporting (default Check.Print).
A function to convert the model state to a string for error reporting ( default Check . Print ) .
initial
The initial state generator.
The initial state generator .