Action3<State, System, T1, T2, T3, R> constructor
Action3<State, System, T1, T2, T3, R> (
- String description,
- Arbitrary<
T1> arbitrary1, - Arbitrary<
T2> arbitrary2, - Arbitrary<
T3> arbitrary3, { - required FutureOr<
void> nextState(- State,
- T1,
- T2,
- T3,
- required FutureOr<
R> run(- System,
- T1,
- T2,
- T3,
- FutureOr<
bool> precondition(- State,
- T1,
- T2,
- T3,
- FutureOr<
bool> postcondition(- State,
- T1,
- T2,
- T3,
- R,
Creates a new action command with 3 arbitraries.
Parameters:
description
: The description of the action.arbitrary1
: The arbitrary used to generate the first value.arbitrary2
: The arbitrary used to generate the second value.arbitrary3
: The arbitrary used to generate the third value.run
: A function to perform the action.precondition
: A function to test the precondition of the action.postcondition
: A function to test the postcondition of the action.
Implementation
Action3(
String description,
Arbitrary<T1> arbitrary1,
Arbitrary<T2> arbitrary2,
Arbitrary<T3> arbitrary3, {
required FutureOr<void> Function(State, T1, T2, T3) nextState,
required FutureOr<R> Function(System, T1, T2, T3) run,
FutureOr<bool> Function(State, T1, T2, T3)? precondition,
FutureOr<bool> Function(State, T1, T2, T3, R)? postcondition,
}) : super(
description,
combine3(arbitrary1, arbitrary2, arbitrary3),
nextState: (s, args) => nextState(s, args.$1, args.$2, args.$3),
run: (sys, args) => run(sys, args.$1, args.$2, args.$3),
precondition: (s, args) => asyncCallOr(
() => precondition?.call(s, args.$1, args.$2, args.$3),
true,
),
postcondition: (s, args, r) => asyncCallOr(
() => postcondition?.call(s, args.$1, args.$2, args.$3, r),
true,
),
);