FakeTransportBuilder class final

A builder for a fake Transport that can be used to return mock responses.

Responses can be returned by registring the handlers for rpcs. The build method builds a transport that responds with the registered handlers and throws an UnimplementedError for the rest of the rpcs.

Constructors

FakeTransportBuilder()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

bidi<I extends Object, O extends Object>(Spec<I, O> spec, Stream<O> handler(Stream<I> request, FakeHandlerContext context)) → FakeTransportBuilder
Register a bidi streaming handler.
build({List<Interceptor>? interceptors}) → Transport
Build the transport.
client<I extends Object, O extends Object>(Spec<I, O> spec, FutureOr<O> handler(Stream<I> request, FakeHandlerContext context)) → FakeTransportBuilder
Register a client streaming handler.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
server<I extends Object, O extends Object>(Spec<I, O> spec, Stream<O> handler(I request, FakeHandlerContext context)) → FakeTransportBuilder
Register a server streaming handler.
toString() → String
A string representation of this object.
inherited
unary<I extends Object, O extends Object>(Spec<I, O> spec, FutureOr<O> handler(I request, FakeHandlerContext context)) → FakeTransportBuilder
Register a unary handler.

Operators

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