Class ProtoTargetProvider

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

A provider described by its parts: a name, the piece that serves the target, the condition, the capabilities it serves and the services the winner contributes. Use it when the provider has no behavior beyond those parts; implement IProtoTargetProvider when it does.

public sealed record ProtoTargetProvider : IProtoTargetProvider, IEquatable<ProtoTargetProvider>
Inheritance
ProtoTargetProvider
Implements
Inherited Members
Extension Methods

Constructors

ProtoTargetProvider(string, IProtoInfrastructure?, IProtoProviderCondition?)

A provider described by its parts: a name, the piece that serves the target, the condition, the capabilities it serves and the services the winner contributes. Use it when the provider has no behavior beyond those parts; implement IProtoTargetProvider when it does.

public ProtoTargetProvider(string Name, IProtoInfrastructure? Infrastructure = null, IProtoProviderCondition? Condition = null)

Parameters

Name string

The provider's name in the resolution record and skip reasons.

Infrastructure IProtoInfrastructure

The piece that serves the target when this provider wins; none when configuration itself serves it.

Condition IProtoProviderCondition

When the provider can serve the target; none means always.

Properties

Capabilities

Gets the capabilities the provider serves. Only the winning provider's capabilities are declared, so a losing provider never advertises something the run cannot do.

public IReadOnlyList<ProtoCapabilityDescriptor> Capabilities { get; init; }

Property Value

IReadOnlyList<ProtoCapabilityDescriptor>

Condition

When the provider can serve the target; none means always.

public IProtoProviderCondition? Condition { get; init; }

Property Value

IProtoProviderCondition

Infrastructure

The piece that serves the target when this provider wins; none when configuration itself serves it.

public IProtoInfrastructure? Infrastructure { get; init; }

Property Value

IProtoInfrastructure

Name

The provider's name in the resolution record and skip reasons.

public string Name { get; init; }

Property Value

string

WinnerServices

The services the provider contributes when it wins its target, in the ConfigureServices(IServiceCollection) contract. null leaves the winner with no services of its own.

public Action<IServiceCollection>? WinnerServices { get; init; }

Property Value

Action<IServiceCollection>