Class ExecuteBuilder<TTarget, TState>
Fluent builder for binding execution logic to operations. Use ExecuteWith<TTarget>() to obtain an instance.
public class ExecuteBuilder<TTarget, TState> where TState : class, IState
Type Parameters
TTargetThe type of the system under test.
TStateThe type of state the spec operates on.
- Inheritance
-
ExecuteBuilder<TTarget, TState>
- Inherited Members
Methods
BindAsync<TRequest, TResponse>(Operation<TRequest, TResponse, TState>, Func<TTarget, TRequest, Task<TResponse>>)
Binds an asynchronous execution function to an operation by reference.
public ExecuteBuilder<TTarget, TState> BindAsync<TRequest, TResponse>(Operation<TRequest, TResponse, TState> operation, Func<TTarget, TRequest, Task<TResponse>> execute)
Parameters
operationOperation<TRequest, TResponse, TState>The operation to bind.
executeFunc<TTarget, TRequest, Task<TResponse>>The async function that executes the operation against the target.
Returns
- ExecuteBuilder<TTarget, TState>
This builder for fluent chaining.
Type Parameters
TRequestThe type of request the operation accepts.
TResponseThe type of response the operation returns.
BindAsync<TRequest, TResponse>(string, Func<TTarget, TRequest, Task<TResponse>>)
Binds an asynchronous execution function to an operation by name.
public ExecuteBuilder<TTarget, TState> BindAsync<TRequest, TResponse>(string operationName, Func<TTarget, TRequest, Task<TResponse>> execute)
Parameters
operationNamestringThe name of the operation to bind.
executeFunc<TTarget, TRequest, Task<TResponse>>The async function that executes the operation against the target.
Returns
- ExecuteBuilder<TTarget, TState>
This builder for fluent chaining.
Type Parameters
TRequestThe type of request the operation accepts.
TResponseThe type of response the operation returns.
Bind<TRequest, TResponse>(Operation<TRequest, TResponse, TState>, Func<TTarget, TRequest, TResponse>)
Binds a synchronous execution function to an operation by reference.
public ExecuteBuilder<TTarget, TState> Bind<TRequest, TResponse>(Operation<TRequest, TResponse, TState> operation, Func<TTarget, TRequest, TResponse> execute)
Parameters
operationOperation<TRequest, TResponse, TState>The operation to bind.
executeFunc<TTarget, TRequest, TResponse>The function that executes the operation against the target.
Returns
- ExecuteBuilder<TTarget, TState>
This builder for fluent chaining.
Type Parameters
TRequestThe type of request the operation accepts.
TResponseThe type of response the operation returns.
Bind<TRequest, TResponse>(string, Func<TTarget, TRequest, TResponse>)
Binds a synchronous execution function to an operation by name.
public ExecuteBuilder<TTarget, TState> Bind<TRequest, TResponse>(string operationName, Func<TTarget, TRequest, TResponse> execute)
Parameters
operationNamestringThe name of the operation to bind.
executeFunc<TTarget, TRequest, TResponse>The function that executes the operation against the target.
Returns
- ExecuteBuilder<TTarget, TState>
This builder for fluent chaining.
Type Parameters
TRequestThe type of request the operation accepts.
TResponseThe type of response the operation returns.
Done()
Returns to the Spec for further configuration (e.g., ProvideTargetAndInitialState).
public Spec<TState> Done()
Returns
- Spec<TState>
The spec this builder was created from.
Operators
implicit operator Spec<TState>(ExecuteBuilder<TTarget, TState>)
Implicit conversion back to Spec for seamless chaining. Allows: spec.ExecuteWith<T>().Bind(...).ProvideTargetAndInitialState(...)
public static implicit operator Spec<TState>(ExecuteBuilder<TTarget, TState> builder)
Parameters
builderExecuteBuilder<TTarget, TState>
Returns
- Spec<TState>