Table of Contents

Class ExecuteBuilder<TTarget, TState>

Namespace
Microsoft.Accordant
Assembly
Accordant.Operations.dll

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

TTarget

The type of the system under test.

TState

The 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

operation Operation<TRequest, TResponse, TState>

The operation to bind.

execute Func<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

TRequest

The type of request the operation accepts.

TResponse

The 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

operationName string

The name of the operation to bind.

execute Func<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

TRequest

The type of request the operation accepts.

TResponse

The 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

operation Operation<TRequest, TResponse, TState>

The operation to bind.

execute Func<TTarget, TRequest, TResponse>

The function that executes the operation against the target.

Returns

ExecuteBuilder<TTarget, TState>

This builder for fluent chaining.

Type Parameters

TRequest

The type of request the operation accepts.

TResponse

The 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

operationName string

The name of the operation to bind.

execute Func<TTarget, TRequest, TResponse>

The function that executes the operation against the target.

Returns

ExecuteBuilder<TTarget, TState>

This builder for fluent chaining.

Type Parameters

TRequest

The type of request the operation accepts.

TResponse

The 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

builder ExecuteBuilder<TTarget, TState>

Returns

Spec<TState>