Exemple #1
0
        public void ReadArmiesTest()
        {
            string       path                = TestContext.CurrentContext.TestDirectory;
            TroopFactory factory             = MockTroopFactory.Create();
            ArmyReader   reader              = new ArmyReader(path, factory);
            Dictionary <string, Army> armies = reader.Read();

            Assert.AreEqual(armies.Count, 2);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            TroopReader troopReader = new TroopReader();

            troopTypes = troopReader.Read();

            TroopFactory troopFactory = new TroopFactory(troopTypes);
            ArmyReader   armyReader   = new ArmyReader(troopFactory);

            armies = armyReader.Read();

            PrintArmy("Good Army");
            Console.WriteLine();
            PrintArmy("Bad Army");

            Army            a   = armies["Good Army"];
            Army            b   = armies["Bad Army"];
            BattleSimulator sim = new BattleSimulator(a, b);

            sim.Battle();
            Console.WriteLine(sim.Result);
            Console.ReadLine();
        }