Ejemplo n.º 1
0
        public void DuelTest_NotPreferred()
        {
            TroopFactory factory = MockTroopFactory.Create();
            Troop        a       = factory.Create("Monkey");
            Troop        b       = factory.Create("Balloon");

            int expectedB = b.Info.Health - a.Info.Damage / 2;

            string result = DuelSimulator.Duel(a, b);

            Assert.AreEqual(expectedB, b.CurrentHealth);

            Console.WriteLine(result);
        }
Ejemplo n.º 2
0
        public void DuelTest_Overkill()
        {
            TroopFactory factory = MockTroopFactory.Create();
            Troop        a       = factory.Create("Wizard");
            Troop        b       = factory.Create("Balloon");

            a.CurrentHealth = 1;

            int expectedB = b.Info.Health - a.Info.Damage;

            string result = DuelSimulator.Duel(a, b);

            Assert.IsTrue(result.Contains("Wizard was killed"));
            Assert.AreEqual(1, b.InflictedDamage);  //Ensure we don't 'overkill' on calculating inflicted damage
            Console.WriteLine(result);
        }