Ejemplo n.º 1
0
        public void BattleEncounterWithArmorAndWeaponsTest()
        {
            Scenario scenario = new Scenario();
            Dwarf    gimli    = new Dwarf();
            Orc      orc      = new Orc();

            BasicSword sword = new BasicSword();
            ChainMail  armor = new ChainMail();
            GoldenCoat coat  = new GoldenCoat();

            orc.AddItem(sword);
            orc.AddItem(armor);
            orc.AddItem(coat);

            List <CharacterClass> heroes = new List <CharacterClass>()
            {
                gimli
            };
            List <CharacterClass> villains = new List <CharacterClass>()
            {
                orc
            };

            BattleEncounter battle = new BattleEncounter(heroes, villains);

            List <List <CharacterClass> > everything = battle.PlayEncounter();

            Assert.AreEqual(0, everything[0][0].HealthActual);
        }
Ejemplo n.º 2
0
        public void HealthReductedTest()
        {
            Dwarf        gimli = new Dwarf();
            StygianBlade sword = new StygianBlade();
            Orc          dummy = new Orc();
            GoldenCoat   coat  = new GoldenCoat();

            gimli.AddItem(sword);
            dummy.AddItem(coat);

            dummy.ReceiveDamage(gimli.Attack());

            Assert.AreEqual(dummy.HealthMax - dummy.HealthActual, gimli.BaseAttackPower + sword.AttackPower - dummy.BaseDefensePower - coat.DefensePower);
        }