Class RequiresApplicationAttribute

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Skips the test unless the suite declares the named application through AddApplication, so an application-specific test reads as skipped when the suite was composed without it instead of failing at the first accessor.

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

Examples

[RequiresApplication("Api")]
public async Task ...() { ... }

Constructors

RequiresApplicationAttribute(string)

public RequiresApplicationAttribute(string name)

Parameters

name string

Properties

Name

The application name the test needs.

public string Name { get; }

Property Value

string

Reason

The reason reported when the application 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