public void Make_Dictionary() { //Arrange List <IUnit> prefabs = new List <IUnit>() { A.MockUnit().Build(), A.MockUnit().Build(), A.MockUnit().Build() }; int numberOfPrefabs = prefabs.Count; IUnitFactory unitFactory = A.MockUnitFactory().With(prefabs).Build(); UnitFactoryController factoryController = new UnitFactoryController(unitFactory); //Act factoryController.MakeDictionnary(); //Assert foreach (IUnit prefab in prefabs) { Assert.IsTrue(factoryController.unitsAvailable.ContainsKey(prefab.template)); } }
private void Awake() { _factoryController = new UnitFactoryController(this); _factoryController.MakeDictionnary(); }