Class ProtoHttpAuthLifecycleHook

Namespace
ProtoTest.Http
Assembly
ProtoTest.Http.dll

Resolves the ordered authenticator attributes that apply to a protocol before each test, builds a composite authenticator when more than one applies, and records the resolved configuration as the protocol's auth entity state. The client a test uses is chosen separately by [Application]. The state is stored under the protocol's key, so protocols sharing this hook never overwrite each other. A test's [SignedInAs] declaration rides along the winning authenticator set, because it names who the test acts as rather than how a request is authenticated.

public sealed class ProtoHttpAuthLifecycleHook : IProtoTestHook
Inheritance
ProtoHttpAuthLifecycleHook
Implements
Inherited Members
Extension Methods

Constructors

ProtoHttpAuthLifecycleHook(ProtoProtocol)

Resolves the ordered authenticator attributes that apply to a protocol before each test, builds a composite authenticator when more than one applies, and records the resolved configuration as the protocol's auth entity state. The client a test uses is chosen separately by [Application]. The state is stored under the protocol's key, so protocols sharing this hook never overwrite each other. A test's [SignedInAs] declaration rides along the winning authenticator set, because it names who the test acts as rather than how a request is authenticated.

public ProtoHttpAuthLifecycleHook(ProtoProtocol protocol)

Parameters

protocol ProtoProtocol

Properties

Order

Order of execution for the hook. Lower values are executed earlier in the lifecycle.

public int Order { get; }

Property Value

int

Methods

AfterTestAsync(ProtoExecutionContext)

Executed asynchronously after a test completes.

public Task AfterTestAsync(ProtoExecutionContext context)

Parameters

context ProtoExecutionContext

Returns

Task

BeforeTestAsync(ProtoExecutionContext)

Executed asynchronously before a test starts.

public Task BeforeTestAsync(ProtoExecutionContext context)

Parameters

context ProtoExecutionContext

Returns

Task