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].

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

Constructors

ProtoHttpAuthLifecycleHook(string)

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].

protected ProtoHttpAuthLifecycleHook(string protocolName)

Parameters

protocolName string

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

SetContext(ProtoExecutionContext, Func<ProtoExecutionContext, IProtoHttpAuthenticator>?)

Stores the resolved authenticator factory as protocol-specific context state.

protected abstract void SetContext(ProtoExecutionContext context, Func<ProtoExecutionContext, IProtoHttpAuthenticator>? authenticatorFactory)

Parameters

context ProtoExecutionContext
authenticatorFactory Func<ProtoExecutionContext, IProtoHttpAuthenticator>