FakeTransport class final

A Transport that answers from a handler on the microtask queue and records every request it was given.

Constructors

FakeTransport(FutureOr<Object?> handler(TransportRequest request, int call))
Creates a transport that answers every request with handler.

Properties

calls → List<TransportRequest>
Every request executed, in order.
final
handler → FutureOr<Object?> Function(TransportRequest request, int call)
Produces the client-shaped response for the request numbered call (zero based), or throws to fail it.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

countOf(OperationMeta meta) → int
How many requests named meta's operation.
execute(TransportRequest request) → Future<Object?>
Runs request. Returns the client-shaped response.
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