MockAction class

MockAction (flattened union; type is respond, delay or fail).

Constructors

MockAction({required String type, int status = 200, List<List<String>> headers = const <List<String>>[], String? body, String bodyEncoding = 'utf8', int delayMs = 0, String error = 'connection', String? message})
const

Properties

body → String?
respond: body text (or base64 when bodyEncoding is base64).
final
bodyEncoding → String
respond: utf8 | base64.
final
delayMs → int
respond/fail: optional delay; delay: required delay.
final
error → String
fail: timeout | connection | dns | tls | custom.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → List<List<String>>
respond: [name, value] pairs.
final
isDelay → bool
no setter
isFail → bool
no setter
isRespond → bool
no setter
message → String?
fail: optional message (used by custom).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → int
respond: HTTP status.
final
type → String
respond | delay | fail.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJson(Object? json) → MockAction?
Returns null for unknown/invalid actions (such rules never match).