expectApiCalled method

void expectApiCalled(
  1. String apiName,
  2. int times
)

Implementation

void expectApiCalled(String apiName, int times) {
  return RunnerBenchmark.sync('assertion', 'expectApiCalled', () {
    final actual = _ensembleContext.apiOverlay.callCount(apiName);
    if (actual != times) {
      throw EnsembleTestFailure(
        'Expected API "$apiName" to be called $times times, but it was called $actual times. '
        '${apiCallSummary()}',
      );
    }
  });
}