ResponseAssert class

A specialized Assert class for handling response-related assertions.

The ResponseAssert class extends Assert and introduces functionality to handle assertions related to HTTP responses, including status code checks.

Inheritance

Constructors

ResponseAssert.new(bool assertion, String message, {int statusCode = 400, Map<String, Object> headers = const {}})
Constructs a ResponseAssert with the provided assertion, message, and statusCode.

Properties

assertion bool
The boolean assertion condition to be checked.
finalinherited
children List<Assert>
The list of child Assert instances to be executed.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, Object>
Header for Response.
final
message String
The message included in the exception if the assertion fails.
finalinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
The HTTP status code for the response if the assertion fails.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
toJSON JSON
Convert this DModel to JSON.
getter/setter pairinherited-setteroverride-getter

Methods

copyWith({bool? assertion, String? message, int? statusCode, Map<String, String>? headers}) ResponseAssert
Copy variables in this DModel and make a new one out of it.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJSON(JSON value) ResponseAssert
Convert a JSON to this DModel.
override