Пример #1
0
        public void SwordsmanVsViking()
        {
            Warrior swordsman = new Swordsman();

            Viking viking = new Viking();

            swordsman.Engage(viking);

            Assert.AreEqual(0, swordsman.HitPoints());
            Assert.AreEqual(35, viking.HitPoints());
        }
Пример #2
0
        static void Main(string[] args)
        {
            //Console.WriteLine("Give me equipment data file");
            //var equipmentfile = Console.ReadLine();
            var equipmentfile = "Equipment.cfg";

            ReadData.ReadFile(equipmentfile);

            Warrior w1 = new Swordsman();
            Warrior w2 = new Viking();

            w1.AddModifier(new DamageModifier(10, 3), "sword");
            w1.SetModifierTotal(new DamageModifier(0, 2));
            w2.Equip("buckler");
            Console.WriteLine(w1.HitPoints().ToString() + " x " + w2.HitPoints().ToString());
            w1.Engage(w2);
            Console.WriteLine(w1.HitPoints().ToString() + " x " + w2.HitPoints().ToString());

            Console.ReadLine();
        }
Пример #3
0
        public void SwordsmanWithBucklerVsVikingWithBuckler()
        {
            Swordsman swordsman = new Swordsman()
                                  .Equip("buckler");

            Viking viking = new Viking()
                            .Equip("buckler");

            swordsman.Engage(viking);

            Assert.AreEqual(0, swordsman.HitPoints());
            Assert.AreEqual(70, viking.HitPoints());
        }