Class ProtoRunSetupContext

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

The run's collected state a run setup step reads: the settings started infrastructure published before the step's registration position, the suite's configuration it can fall back to, and the run's start cancellation token. Read Settings first and Configuration second - the precedence every address reader follows - so a container the environment replaced with a configured address is skipped and the configuration value still reaches the step.

public sealed record ProtoRunSetupContext : IEquatable<ProtoRunSetupContext>
Inheritance
ProtoRunSetupContext
Implements
Inherited Members
Extension Methods

Constructors

ProtoRunSetupContext(ProtoInfrastructureSettings, IConfiguration, CancellationToken)

The run's collected state a run setup step reads: the settings started infrastructure published before the step's registration position, the suite's configuration it can fall back to, and the run's start cancellation token. Read Settings first and Configuration second - the precedence every address reader follows - so a container the environment replaced with a configured address is skipped and the configuration value still reaches the step.

public ProtoRunSetupContext(ProtoInfrastructureSettings Settings, IConfiguration Configuration, CancellationToken CancellationToken)

Parameters

Settings ProtoInfrastructureSettings
Configuration IConfiguration
CancellationToken CancellationToken

Properties

CancellationToken

public CancellationToken CancellationToken { get; init; }

Property Value

CancellationToken

Configuration

public IConfiguration Configuration { get; init; }

Property Value

IConfiguration

Services

The run's services; empty for a context built outside a run.

public IServiceProvider Services { get; }

Property Value

IServiceProvider

Settings

public ProtoInfrastructureSettings Settings { get; init; }

Property Value

ProtoInfrastructureSettings

Methods

ApplicationClientAsync(string)

An HTTP client for an application, released when the phase ends: its address when one is configured or published, otherwise its in-process server. Available in AfterInfrastructureAsync(ProtoRunSetupContext), once every piece the application reads started.

public ValueTask<HttpClient> ApplicationClientAsync(string applicationName)

Parameters

applicationName string

Returns

ValueTask<HttpClient>