addToBuffer method

void addToBuffer(
  1. dynamic elements
)

Use this to simulate stdin.

std_output = StdoutService(mock: true);
std_input = StdinService(mock: true, informStdout: std_output);
std_input.addToBuffer('Some input\n', ...Keys.arrowDown, Keys.enter);

Implementation

void addToBuffer(elements) {
  if (elements is Iterable) {
    _mockBuffer.addAll(elements);
  } else {
    _mockBuffer.add(elements); // that is, if it is only one element
  }
}