Table of Contents

Class TypedExpectBuilderStateExtensions

Namespace
Microsoft.Accordant
Assembly
Accordant.Operations.dll

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

builder TypedExpectBuilder<TResponse, TState>

The builder to extend.

modifier Action<TResponse, TState, Dictionary<object, object>>

An action that receives the response and modifies the cloned state, with access to the clone map.

mock Func<TResponse>

A function that generates a mock response for state exploration.

Returns

TypedExpectBuilder<TResponse, TState>

The builder for method chaining.

Type Parameters

TResponse

The response type.

TState

The 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

builder TypedExpectBuilder<TResponse, TState>

The builder to extend.

modifier Action<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

TResponse

The response type.

TState

The state type, must derive from State.