Class RequiresServerAttribute

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Skips the test unless the host is composed with the named ASP.NET Core server, for example the instance registered by AddAspNetCoreServer<TProgram>(name). The check addresses the capability's Instance - the server name - so a configured address that drops one named server does not satisfy a gate for another.

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

Examples

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

Constructors

RequiresServerAttribute(string)

public RequiresServerAttribute(string name)

Parameters

name string

Properties

DefaultReason

protected override string DefaultReason { get; }

Property Value

string

ServerName

The server name the test needs.

public string ServerName { get; }

Property Value

string