public void InitializeTests() { var powerGenerator = new PowerGenerator(); var weaponFactory = new WeaponFactory(); var combatantFactory = new CombatantFactory(powerGenerator, weaponFactory); this.armyA = new Army(powerGenerator, combatantFactory) { Health = 100 }; this.armyB = new Army(powerGenerator, combatantFactory) { Health = 100 }; this.warLogic = new WarLogic(); }
/// <summary> /// Selects an action based on the printed menu. /// </summary> /// <param name="menuOption"></param> public static void SelectFromMenu(string menuOption) { if (string.IsNullOrEmpty(menuOption)) throw new ArgumentNullException("menuOption"); switch (menuOption) { case "A": var powerGenerator = new PowerGenerator(); var armyA = new Army(powerGenerator) { Name = "England", Health = 100 }; var armyB = new Army(powerGenerator) { Name = "Rome", Health = 100 }; var warLogic = new WarLogic(); warLogic.OnWarEnding += OnWarEnding; warLogic.GoToWar(armyA, armyB); break; case "Q": Console.WriteLine("Quitting the game."); break; default: throw new ArgumentException(string.Format("Unknown parameter value: {0}", menuOption), "menuOption"); } }
public void TestSetup() { var powerGenerator = new PowerGenerator(); var weaponFactory = new WeaponFactory(); var combatantFactory = new CombatantFactory(powerGenerator, weaponFactory); this.army = new Army(powerGenerator, combatantFactory) { Health = 100 }; this.enemyArmy = new Army(powerGenerator, combatantFactory) { Health = 100 }; }