Class TestExecutionOptions
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
AfterAllAsync
Called once after all tests complete (async). Use for one-time cleanup.
public Func<AfterAllInfo, Task> AfterAllAsync { get; set; }
Property Value
AfterEach
Called after each test case completes (success or failure).
public Action<AfterTestInfo> AfterEach { get; set; }
Property Value
AfterEachAsync
Called after each test case (async), success or failure.
public Func<AfterTestInfo, Task> AfterEachAsync { get; set; }
Property Value
BeforeAll
Called once before any tests run. Use for one-time setup.
public Action<BeforeAllInfo> BeforeAll { get; set; }
Property Value
BeforeAllAsync
Called once before any tests run (async). Use for one-time setup.
public Func<BeforeAllInfo, Task> BeforeAllAsync { get; set; }
Property Value
BeforeEach
Called before each test case, after target/state creation.
public Action<BeforeTestInfo> BeforeEach { get; set; }
Property Value
BeforeEachAsync
Called before each test case (async), after target/state creation.
public Func<BeforeTestInfo, Task> BeforeEachAsync { get; set; }
Property Value
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
OnStepExecutedAsync
Called after each operation or batch of concurrent operations executes (async).
public Func<StepExecutedInfo, Task> OnStepExecutedAsync { get; set; }
Property Value
ShouldRetry
Controls retry behavior for operations.
public ShouldRetryOperationLambda ShouldRetry { get; set; }
Property Value
StopOnFirstFailure
Stop on first failure. Default: true.
public bool StopOnFirstFailure { get; set; }
Property Value
Methods
WithAfterEach(Action<AfterTestInfo>)
Sets an AfterEach hook. Use info.Context to access the TestingContext.
public TestExecutionOptions WithAfterEach(Action<AfterTestInfo> action)
Parameters
actionAction<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
actionFunc<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
actionAction<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
actionFunc<BeforeTestInfo, Task>Async action to run before each test.
Returns
- TestExecutionOptions
This instance for chaining.