Class RequiresCapabilityAttribute

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Skips the test unless the host is composed with a capability of the given kind - for example a test-side domain that only exists when the suite owns the store. The kind is open, like capability kinds themselves; ProtoCapabilityKinds lists the built-in ones.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequiresCapabilityAttribute : ProtoAttribute, IProtoSkipCondition
Inheritance
RequiresCapabilityAttribute
Implements
Derived
Inherited Members
Extension Methods

Constructors

RequiresCapabilityAttribute(string)

public RequiresCapabilityAttribute(string kind)

Parameters

kind string

Properties

CapabilityName

The capability name within the kind, when a specific one is required.

public string? CapabilityName { get; init; }

Property Value

string

DefaultReason

protected virtual string DefaultReason { get; }

Property Value

string

Kind

The capability kind the test needs.

public string Kind { get; }

Property Value

string

Reason

The reason reported when the capability is missing.

public string? Reason { get; init; }

Property Value

string

Methods

GetSkipReason(ProtoHost)

Returns the reason to skip, or null when the test can run.

public string? GetSkipReason(ProtoHost host)

Parameters

host ProtoHost

Returns

string