combinedFactories method

Map<String, FactoryFunc> combinedFactories(
  1. Map<String, FactoryFunc> underTest
)

Implementation

Map<String, FactoryFunc> combinedFactories(
    Map<String, FactoryFunc> underTest) {
  final ret = <String, FactoryFunc>{};
  for (var mod in modules) {
    if (mod is MockModule) {
      ret[mod._moduleClass] = mod.getMockFactory(this);
    } else if (mod is UnderTest) {
      if (!underTest.containsKey(mod.moduleClass)) {
        throw ArgumentError(
            'moduleClass "${mod.moduleClass}" not found in factories');
      }
      ret[mod.moduleClass!] = underTest[mod.moduleClass]!;
    }
  }
  _allFactories = ret;
  return ret;
}