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
expectedStatusCodeHttpStatusCodeactualStatusCodeHttpStatusCoderesponseBodystring
RestStatusAssertionException(HttpStatusCode, HttpStatusCode, string?, bool)
public RestStatusAssertionException(HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, string? responseBody, bool negated)
Parameters
expectedStatusCodeHttpStatusCodeactualStatusCodeHttpStatusCoderesponseBodystringnegatedbool
Properties
ActualStatusCode
public HttpStatusCode ActualStatusCode { get; }
Property Value
ExpectedStatusCode
public HttpStatusCode ExpectedStatusCode { get; }
Property Value
Negated
Whether the failed assertion asked for a status other than ExpectedStatusCode.
public bool Negated { get; }
Property Value
ResponseBody
public string ResponseBody { get; }