Class TypedExpectBuilderStateExtensions
Extension methods for TypedExpectBuilder<TResponse, TState> that require TState to derive from State (not just implement IState). These methods use CloneWithMap which is a State-specific feature for cycle-aware cloning.
public static class TypedExpectBuilderStateExtensions
- Inheritance
-
TypedExpectBuilderStateExtensions
- Inherited Members
Methods
ThenStateWithMap<TResponse, TState>(TypedExpectBuilder<TResponse, TState>, Action<TResponse, TState, Dictionary<object, object>>, Func<TResponse>)
Specifies a response-dependent next state with access to the state clone map. The framework automatically clones the current state with CloneWithMap() and passes both the clone and the mapping from original to cloned states.
public static TypedExpectBuilder<TResponse, TState> ThenStateWithMap<TResponse, TState>(this TypedExpectBuilder<TResponse, TState> builder, Action<TResponse, TState, Dictionary<object, object>> modifier, Func<TResponse> mock) where TState : State
Parameters
builderTypedExpectBuilder<TResponse, TState>The builder to extend.
modifierAction<TResponse, TState, Dictionary<object, object>>An action that receives the response and modifies the cloned state, with access to the clone map.
mockFunc<TResponse>A function that generates a mock response for state exploration.
Returns
- TypedExpectBuilder<TResponse, TState>
The builder for method chaining.
Type Parameters
TResponseThe response type.
TStateThe state type, must derive from State.
ThenStateWithMap<TResponse, TState>(TypedExpectBuilder<TResponse, TState>, Action<TState, Dictionary<object, object>>)
Specifies a next state using a modifier action with access to the state clone map. The framework automatically clones the current state with CloneWithMap() and passes both the clone and the mapping from original to cloned states.
public static TypedExpectBuilder<TResponse, TState> ThenStateWithMap<TResponse, TState>(this TypedExpectBuilder<TResponse, TState> builder, Action<TState, Dictionary<object, object>> modifier) where TState : State
Parameters
builderTypedExpectBuilder<TResponse, TState>The builder to extend.
modifierAction<TState, Dictionary<object, object>>An action that modifies the cloned state, with access to the clone map.
Returns
- TypedExpectBuilder<TResponse, TState>
The builder for method chaining.
Type Parameters
TResponseThe response type.
TStateThe state type, must derive from State.