Class RestStatusAssertionException

Namespace
ProtoTest.Rest.Exceptions
Assembly
ProtoTest.Rest.dll

Represents a failed assertion against an HTTP response status code. A negated assertion states that the status must not equal the expected value, so its message reads with "not".

public sealed class RestStatusAssertionException : ProtoAssertionException, ISerializable
Inheritance
RestStatusAssertionException
Implements
Inherited Members
Extension Methods

Constructors

RestStatusAssertionException(HttpStatusCode, HttpStatusCode, string?)

public RestStatusAssertionException(HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, string? responseBody)

Parameters

expectedStatusCode HttpStatusCode
actualStatusCode HttpStatusCode
responseBody string

RestStatusAssertionException(HttpStatusCode, HttpStatusCode, string?, bool)

public RestStatusAssertionException(HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, string? responseBody, bool negated)

Parameters

expectedStatusCode HttpStatusCode
actualStatusCode HttpStatusCode
responseBody string
negated bool

Properties

ActualStatusCode

public HttpStatusCode ActualStatusCode { get; }

Property Value

HttpStatusCode

ExpectedStatusCode

public HttpStatusCode ExpectedStatusCode { get; }

Property Value

HttpStatusCode

Negated

Whether the failed assertion asked for a status other than ExpectedStatusCode.

public bool Negated { get; }

Property Value

bool

ResponseBody

public string ResponseBody { get; }

Property Value

string