FakeHttpTransport class

A scriptable, dependency-light fake transport implementing the real HttpTransport seam, so a contract-parity suite runs the SAME behaviour against this fake and a real transport. Records every request.

Implemented types

Constructors

FakeHttpTransport(TransportOutcome _responder(HttpRequest request))
FakeHttpTransport.byHost(Map<String, TransportOutcome> byHost, {TransportOutcome orElse = const NetworkFailure('unmapped host')})
Route outcomes by request host; falls back to orElse.
factory
FakeHttpTransport.sequence(List<TransportOutcome> outcomes)
Replay a fixed sequence of outcomes, one per call (last repeats).
factory

Properties

callCount → int
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sent → List<HttpRequest>
Every request the transport handled, in order.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(HttpRequest request) → Future<TransportOutcome>
override
toString() → String
A string representation of this object.
inherited

Operators

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