Esempio n. 1
0
        public void HasBattleEnded()
        {
            var encounter = new Encounter(new Goomba(), new SpikedGoomba());
            var battle    = new Battle.Battle(new List <Hero> {
                mario
            }, encounter);

            battle.End();
            Assert.IsTrue(battle.IsEnded());
            Assert.IsFalse(battle.IsStarted());
        }
Esempio n. 2
0
        public void HasBattleEndedAfterAllEnemiesKilled()
        {
            var goomba    = new Goomba();
            var encounter = new Encounter(goomba, new SpikedGoomba());
            var battle    = new Battle.Battle(new List <Hero> {
                mario
            }, encounter);

            battle.Start();
            Assert.IsTrue(battle.IsStarted());
            //Can you kill a goomba if the battle has started??
            battle.Enemies.ForEach(enemy => enemy.Kill());
            Assert.IsTrue(battle.IsEnded());
            Assert.IsFalse(battle.IsStarted());
        }