Ejemplo n.º 1
0
        public void WhatIfThereAreMoreEnemiesThanHeroes()
        {
            Scenario scenario = new Scenario();

            Dwarf     gimli   = new Dwarf();
            Elf       legolas = new Elf();
            ChosenOne aragorn = new ChosenOne();
            Wizard    gandalf = new Wizard();

            Orc orc  = new Orc();
            Orc orc2 = new Orc();
            Orc orc3 = new Orc();
            Orc orc4 = new Orc();
            Orc orc5 = new Orc();

            List <CharacterClass> heroes = new List <CharacterClass>()
            {
                gimli, legolas, aragorn, gandalf
            };
            List <CharacterClass> villains = new List <CharacterClass>()
            {
                orc, orc2, orc3, orc4, orc5
            };

            BattleEncounter battle = new BattleEncounter(heroes, villains);

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

            Assert.IsTrue(battle.EveryoneDead(everything[1]));
        }
Ejemplo n.º 2
0
        public void BookOfWisdomWorksForWizards()
        {
            Scenario scenario = new Scenario();
            Wizard   gandalf  = new Wizard();
            Orc      orc      = new Orc();

            Excalibur sword = new Excalibur();

            gandalf.AddItem(sword);

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

            BattleEncounter battle = new BattleEncounter(heroes, villains);

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

            Assert.AreEqual($"-{everything[1][0].Name} has been slain by {everything[0][0].Name}", everything[0][0].Registres.ShowRegistres());
        }
Ejemplo n.º 3
0
        public void BattleEncounterEndsWhenEveryoneOnOneSideDiesPart2Test()
        {
            Scenario scenario = new Scenario();

            Dwarf     gimli   = new Dwarf();
            Elf       legolas = new Elf();
            ChosenOne aragorn = new ChosenOne();
            Wizard    gandalf = new Wizard();

            DarkLord orc  = new DarkLord();
            DarkLord orc2 = new DarkLord();
            DarkLord orc3 = new DarkLord();
            DarkLord orc4 = new DarkLord();

            List <CharacterClass> heroes = new List <CharacterClass>()
            {
                gimli, legolas, aragorn, gandalf
            };
            List <CharacterClass> villains = new List <CharacterClass>()
            {
                orc, orc2, orc3, orc4
            };

            BattleEncounter battle = new BattleEncounter(heroes, villains);

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

            Assert.IsTrue(battle.EveryoneDead(everything[0]));
        }
Ejemplo n.º 4
0
        public void BattleEncounterEndsWhenEveryoneOnOneSideDiesTest()
        {
            Scenario scenario = new Scenario();

            Dwarf     gimli   = new Dwarf();
            Elf       legolas = new Elf();
            ChosenOne aragorn = new ChosenOne();
            Wizard    gandalf = new Wizard();

            Orc orc  = new Orc();
            Orc orc2 = new Orc();
            Orc orc3 = new Orc();
            Orc orc4 = new Orc();

            List <CharacterClass> heroes = new List <CharacterClass>()
            {
                gimli, legolas, aragorn, gandalf
            };
            List <CharacterClass> villains = new List <CharacterClass>()
            {
                orc, orc2, orc3, orc4
            };

            BattleEncounter battle = new BattleEncounter(heroes, villains);

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

            Assert.AreEqual(0, everything[1][0].HealthActual + everything[1][1].HealthActual + everything[1][2].HealthActual + everything[1][3].HealthActual);
        }
Ejemplo n.º 5
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.º 6
0
        public void EternalStoneWorksForHeroes()
        {
            Scenario scenario = new Scenario();
            Dwarf    gimli    = new Dwarf();
            Orc      orc      = new Orc();

            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("1", gimli.Registres.ShowRegistres());
        }
Ejemplo n.º 7
0
        public void BattleEncounterNoWeaponsTest()
        {
            Scenario scenario = new Scenario();
            Dwarf    gimli    = new Dwarf();
            Orc      orc      = new Orc();

            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[1][0].HealthActual);
        }
Ejemplo n.º 8
0
        public void ThousandYearTreeTest()
        {
            Scenario scenario = new Scenario();
            Dwarf    gimli    = new Dwarf();
            Dragon   dragon   = new Dragon();


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

            BattleEncounter battle = new BattleEncounter(heroes, villains);

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

            Assert.AreEqual(gimli.Name, everything[1][0].Registres.ShowRegistres());
        }