Class RestAssertions
public class RestAssertions : ProtoHttpAssertions<RestResponse>
- Inheritance
-
RestAssertions
- Derived
- Inherited Members
- Extension Methods
Methods
AssertStatus(HttpStatusCode, bool)
Runs the protocol's status assertion with the facade's polarity.
protected override RestResponse AssertStatus(HttpStatusCode expected, bool negated)
Parameters
expectedHttpStatusCodenegatedbool
Returns
HaveContentType(string)
Asserts the response body's content type, comparing its media type without parameters (case-insensitively); on ShouldNot it asserts the response carries anything but that media type. Returns the response.
public RestResponse HaveContentType(string mediaType)
Parameters
mediaTypestring
Returns
HaveCookie(string)
Asserts the response sets a cookie with name (case-sensitive, as cookie
names are); on ShouldNot it asserts the cookie is not set. Returns
the response.
public RestResponse HaveCookie(string name)
Parameters
namestring
Returns
HaveCookie(string, string)
Asserts the response sets a cookie with name and a value equal to
value (ordinal); on ShouldNot it asserts no such
value is set. Returns the response.
public RestResponse HaveCookie(string name, string value)
Parameters
Returns
HaveHeader(string)
Asserts the response carries a header with name; on
ShouldNot it asserts the header is absent. Returns the response.
public RestResponse HaveHeader(string name)
Parameters
namestring
Returns
HaveHeader(string, string)
Asserts the response carries a header with name and a value equal to
value (ordinal; any value of a multi-valued header matches); on
ShouldNot it asserts no such value is present. Returns the response.
public RestResponse HaveHeader(string name, string value)
Parameters
Returns
HaveRedirectLocation(string)
Asserts the response's Location header equals location as it arrived
(ordinal, relative or absolute); on ShouldNot it asserts the header
carries anything but that location. Returns the response.
public RestResponse HaveRedirectLocation(string location)
Parameters
locationstring