InMemoryConnection class final Testing

One side of an in-memory connection.

Implemented types

Properties

done → Future<void>
Completes when the connection is closed, by either side.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
input → Stream<Uint8List>
The bytes received from the server. Single subscription; it closes when the connection closes and reports transport errors.
no setteroverride
isClosed → bool
Whether the connection has been closed by either side.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(List<int> bytes) → void
Sends bytes to the server.
override
close() → Future<void>
Closes the connection. Safe to call more than once.
override
fail(Object error) → void
Simulates a network failure: both sides see error and the connection closes.
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

pair() → (InMemoryConnection, InMemoryConnection)
Creates two connected ends: bytes added to one arrive on the other's input.