thenReturn method

void thenReturn (T expected)

Implementation

void thenReturn(T expected) {
  if (expected is Future) {
    throw new ArgumentError(
        '`thenReturn` should not be used to return a Future. '
        'Instead, use `thenAnswer((_) => future)`.');
  }
  if (expected is Stream) {
    throw new ArgumentError(
        '`thenReturn` should not be used to return a Stream. '
        'Instead, use `thenAnswer((_) => stream)`.');
  }
  return _completeWhen((_) => expected);
}