TesterStateMachine<STATE extends Object, ACTION extends Object> class

A state machine for testing.

Implemented types

Constructors

TesterStateMachine.new({required GraphBuilder<STATE, ACTION> graphBuilder, required STATE initialState, List<SideEffectCreator<STATE, ACTION, SideEffect>> sideEffectCreators = const [], List<Subscription<STATE, ACTION>> subscriptions = const []})
Creates a state machine for testing.

Properties

createdSideEffect List<SideEffect>
The created side effects.
no setter
hashCode int
The hash code for this object.
no setterinherited
isPrevTransitionValid bool
Whether the previous transition is valid.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → STATE
The current state of the state machine.
no setterinherited
stateStream Stream<STATE>
A stream of the state machine's state.
no setterinherited

Methods

afterJob(ACTION action, Valid<STATE, ACTION> validTransition) Future<void>
Execute AfterSideEffect
beforeJob(ACTION action) Future<void>
Execute BeforeSideEffect
close() → void
Closes the state machine and releases resources.
inherited
dispatch(ACTION action) → void
Dispatches an action to the state machine.
finallyJob(Transition<STATE, ACTION> transition) Future<void>
Execute FinallySideEffect
findAfterJob(ACTION action, Valid<STATE, ACTION> validTransition) List<AfterSideEffect<Object, Object>>
Create AfterSideEffect from AfterSideEffectCreator
inherited
findBeforeJob(ACTION action) List<BeforeSideEffect<Object, Object>>
Create BeforeSideEffect from BeforeSideEffectCreator
inherited
findFinallyJob(Transition<STATE, ACTION> transition) List<FinallySideEffect<Object, Object>>
Create FinallySideEffect from FinallySideEffectCreator
inherited
findTransition(STATE currentState, ACTION action) Transition<STATE, ACTION>
Finds a Transition corresponding to currentState and action from the Graph of the StateMachine. If found, it returns the destination STATE as Valid, and if not found, it returns Invalid.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited