thenReturn method

void thenReturn(
  1. T expected
)

Store a canned response for this method stub.

Note: expected cannot be a Future or Stream, due to Zone considerations. To return a Future or Stream from a method stub, use thenAnswer.

Implementation

void thenReturn(T expected) {
  _throwIfInvalid(expected);
  return _completeWhen((_) => expected);
}