test method

void test({
  1. String? testDescription,
  2. int? nrFeature,
  3. UnitMocks? mocks,
  4. SUT? systemUnderTest,
})

Runs this UnitFeature's UnitScenario.test methods.

Implementation

void test({
  String? testDescription,
  int? nrFeature,
  UnitMocks? mocks,
  SUT? systemUnderTest,
}) {
  flutter_test.group(
    _description,
    () {
      final _mocks = mocks ?? UnitMocks();
      _setUpMocks?.call(_mocks);
      final _systemUnderTest =
          _systemUnderTestCallback?.call(_mocks) ?? systemUnderTest;
      _setUpAndTeardown(mocks: _mocks, systemUnderTest: _systemUnderTest);
      for (int nrScenario = 0; nrScenario < _scenarios.length; nrScenario++) {
        _scenarios[nrScenario].test(
          featureDescription: _description,
          testDescription: testDescription,
          nrScenario: nrScenario,
          nrFeature: nrFeature,
          mocks: _mocks,
          systemUnderTest: _systemUnderTest,
        );
      }
    },
  );
}