ResponseExpect class

Fluent assertion builder for TestResponse.

Constructors

ResponseExpect(TestResponse _response)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

body(Object expected) Future<ResponseExpect>
Asserts the response body matches the expected value.
contentType(String expected) ResponseExpect
Asserts the response has the given content type.
Asserts the response has a header with the given value.
isClientError() ResponseExpect
Asserts the response status is in the 4xx range.
isOk() ResponseExpect
Asserts the response status is in the 2xx range.
isServerError() ResponseExpect
Asserts the response status is in the 5xx range.
jsonEquals(Map<String, dynamic> expected) Future<ResponseExpect>
Asserts the JSON body matches the expected map.
jsonPath(String path, Object expected) Future<ResponseExpect>
Asserts a JSON path has the expected value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
status(int expected) ResponseExpect
Asserts the response has the given status code.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited