Class ProtoHttpAssertions<TResponse>

Namespace
ProtoTest.Http
Assembly
ProtoTest.Http.dll

The status-assertion facade an HTTP protocol exposes: HaveHttpStatus(HttpStatusCode) runs the protocol's assertion with the facade's polarity, so Should and ShouldNot read the same in every protocol.

public abstract class ProtoHttpAssertions<TResponse> where TResponse : ProtoHttpResponse

Type Parameters

TResponse
Inheritance
ProtoHttpAssertions<TResponse>
Derived
Inherited Members
Extension Methods

Constructors

ProtoHttpAssertions(TResponse, bool)

protected ProtoHttpAssertions(TResponse response, bool negated)

Parameters

response TResponse
negated bool

Properties

Negated

Whether the facade asks for the opposite of its assertions.

protected bool Negated { get; }

Property Value

bool

Response

The response the assertions run against.

protected TResponse Response { get; }

Property Value

TResponse

Methods

AssertStatus(HttpStatusCode, bool)

Runs the protocol's status assertion with the facade's polarity.

protected abstract TResponse AssertStatus(HttpStatusCode expected, bool negated)

Parameters

expected HttpStatusCode
negated bool

Returns

TResponse

HaveHttpStatus(HttpStatusCode)

Asserts the HTTP status; the negated form asserts it is anything but expected.

public TResponse HaveHttpStatus(HttpStatusCode expected)

Parameters

expected HttpStatusCode

Returns

TResponse