MockTransport class final

An in-memory GqlifyTransport for tests and examples.

Records every request in requests. The handler may throw (for example a GqlifyTransportException) to simulate transport failures.

Implemented types

Constructors

MockTransport(MockHandler handler)
MockTransport.fixed(Map<String, Object?> body)
Always answers with body.

Properties

handler → MockHandler
final
hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
no setter
requests → List<GqlifyRequest>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
Releases resources held by the transport.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(GqlifyRequest request) → Future<Map<String, Object?>>
override
toString() → String
A string representation of this object.
inherited

Operators

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