Interface IProtoRunHook

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Defines lifecycle hooks that run once per test suite execution (before all tests start and after all tests finish).

public interface IProtoRunHook
Extension Methods

Properties

Order

Execution order for the hook. Lower numbers run earlier during setup and later during teardown.

int Order { get; }

Property Value

int

Methods

AfterInfrastructureAsync(ProtoRunSetupContext)

Executed once after every infrastructure piece started and before the first test. The context reaches the run's applications, so a hook can read what an application serves, such as its API description. A failure fails the run's start and releases what started.

Task AfterInfrastructureAsync(ProtoRunSetupContext context)

Parameters

context ProtoRunSetupContext

Returns

Task

AfterRunAsync(CancellationToken)

Executed once asynchronously after all tests in the suite have completed.

Task AfterRunAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

BeforeRunAsync(CancellationToken)

Executed once asynchronously prior to running any tests in the suite.

Task BeforeRunAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task