Table of Contents

Class TestExecutionOptions

Namespace
Microsoft.Accordant
Assembly
Accordant.Operations.dll

Options and configurations used during test execution.

public class TestExecutionOptions
Inheritance
TestExecutionOptions
Inherited Members

Properties

AfterAll

Called once after all tests complete. Use for one-time cleanup.

public Action<AfterAllInfo> AfterAll { get; set; }

Property Value

Action<AfterAllInfo>

AfterAllAsync

Called once after all tests complete (async). Use for one-time cleanup.

public Func<AfterAllInfo, Task> AfterAllAsync { get; set; }

Property Value

Func<AfterAllInfo, Task>

AfterEach

Called after each test case completes (success or failure).

public Action<AfterTestInfo> AfterEach { get; set; }

Property Value

Action<AfterTestInfo>

AfterEachAsync

Called after each test case (async), success or failure.

public Func<AfterTestInfo, Task> AfterEachAsync { get; set; }

Property Value

Func<AfterTestInfo, Task>

BeforeAll

Called once before any tests run. Use for one-time setup.

public Action<BeforeAllInfo> BeforeAll { get; set; }

Property Value

Action<BeforeAllInfo>

BeforeAllAsync

Called once before any tests run (async). Use for one-time setup.

public Func<BeforeAllInfo, Task> BeforeAllAsync { get; set; }

Property Value

Func<BeforeAllInfo, Task>

BeforeEach

Called before each test case, after target/state creation.

public Action<BeforeTestInfo> BeforeEach { get; set; }

Property Value

Action<BeforeTestInfo>

BeforeEachAsync

Called before each test case (async), after target/state creation.

public Func<BeforeTestInfo, Task> BeforeEachAsync { get; set; }

Property Value

Func<BeforeTestInfo, Task>

OnStepExecuted

Called after each operation or batch of concurrent operations executes. Use for detailed request/response logging.

public Action<StepExecutedInfo> OnStepExecuted { get; set; }

Property Value

Action<StepExecutedInfo>

OnStepExecutedAsync

Called after each operation or batch of concurrent operations executes (async).

public Func<StepExecutedInfo, Task> OnStepExecutedAsync { get; set; }

Property Value

Func<StepExecutedInfo, Task>

ShouldRetry

Controls retry behavior for operations.

public ShouldRetryOperationLambda ShouldRetry { get; set; }

Property Value

ShouldRetryOperationLambda

StopOnFirstFailure

Stop on first failure. Default: true.

public bool StopOnFirstFailure { get; set; }

Property Value

bool

Methods

WithAfterEach(Action<AfterTestInfo>)

Sets an AfterEach hook. Use info.Context to access the TestingContext.

public TestExecutionOptions WithAfterEach(Action<AfterTestInfo> action)

Parameters

action Action<AfterTestInfo>

Action to run after each test.

Returns

TestExecutionOptions

This instance for chaining.

WithAfterEachAsync(Func<AfterTestInfo, Task>)

Sets an async AfterEach hook. Use info.Context to access the TestingContext.

public TestExecutionOptions WithAfterEachAsync(Func<AfterTestInfo, Task> action)

Parameters

action Func<AfterTestInfo, Task>

Async action to run after each test.

Returns

TestExecutionOptions

This instance for chaining.

WithBeforeEach(Action<BeforeTestInfo>)

Sets a BeforeEach hook. Use info.Context to access the TestingContext for service registration.

public TestExecutionOptions WithBeforeEach(Action<BeforeTestInfo> action)

Parameters

action Action<BeforeTestInfo>

Action to run before each test.

Returns

TestExecutionOptions

This instance for chaining.

WithBeforeEachAsync(Func<BeforeTestInfo, Task>)

Sets an async BeforeEach hook. Use info.Context to access the TestingContext for service registration.

public TestExecutionOptions WithBeforeEachAsync(Func<BeforeTestInfo, Task> action)

Parameters

action Func<BeforeTestInfo, Task>

Async action to run before each test.

Returns

TestExecutionOptions

This instance for chaining.