Class ProtoHttpAssertions<TResponse>
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
responseTResponsenegatedbool
Properties
Negated
Whether the facade asks for the opposite of its assertions.
protected bool Negated { get; }
Property Value
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
expectedHttpStatusCodenegatedbool
Returns
- TResponse
HaveHttpStatus(HttpStatusCode)
Asserts the HTTP status; the negated form asserts it is anything but expected.
public TResponse HaveHttpStatus(HttpStatusCode expected)
Parameters
expectedHttpStatusCode
Returns
- TResponse