Esempio n. 1
0
        public void PurchasePotion_ShouldReturnObjectWithDefaultValues()
        {
            var potion = FightClubGame.PurchasePotion();

            Assert.AreEqual(2, potion.Healing);
            Assert.AreEqual(PotionType.Basic, potion.Type);
        }
        public void HireFighter_ShouldReturnObjectWithDefaultValues()
        {
            var fighter = FightClubGame.HireFighter();

            Assert.AreEqual(1, fighter.Damage);
            Assert.AreEqual(10, fighter.Health);
            Assert.AreEqual(FighterState.Healthy, fighter.State);
        }
Esempio n. 3
0
        public void PowerUp_ShouldAllowExternalPropertyChanges()
        {
            var powerUp = FightClubGame.PurchasePowerUp();

            powerUp.DamageBuff = 5;

            Assert.AreEqual(5, powerUp.DamageBuff);
        }
        public void DrinkPotion_ShouldNotChangeHealth_WhenHealthIsMax()
        {
            var fighter = FightClubGame.HireFighter();
            var potion  = FightClubGame.PurchasePotion();

            fighter.DrinkPotion(potion);

            Assert.AreEqual(10, fighter.Health);
        }
Esempio n. 5
0
        public void Potion_ShouldSupportBasicType()
        {
            var potion = FightClubGame.PurchasePotion();

            potion.SetType(PotionType.Basic);

            Assert.AreEqual(2, potion.Healing);
            Assert.AreEqual(PotionType.Basic, potion.Type);
        }
Esempio n. 6
0
        public void Potion_ShouldSupportGreaterType()
        {
            var potion = FightClubGame.PurchasePotion();

            potion.SetType(PotionType.Greater);

            Assert.AreEqual(5, potion.Healing);
            Assert.AreEqual(PotionType.Greater, potion.Type);
        }
        public void TakeDamage_ShouldReduceHealthByFightersDamage()
        {
            var firstFighter  = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();

            firstFighter.TakeDamage(secondFighter);

            Assert.AreEqual(9, firstFighter.Health);
            Assert.AreEqual(10, secondFighter.Health);
        }
Esempio n. 8
0
        public void PowerUp_ShouldIncreasePower()
        {
            var fighter = FightClubGame.HireFighter();
            var powerUp = FightClubGame.PurchasePowerUp();

            powerUp.DamageBuff = 5;

            fighter.PowerUp(powerUp);

            Assert.AreEqual(6, fighter.Damage);
        }
Esempio n. 9
0
        public void PowerUp_ShouldNeverSetDamageBelowOne()
        {
            var fighter = FightClubGame.HireFighter();
            var powerUp = FightClubGame.PurchasePowerUp();

            powerUp.DamageBuff = -4;

            fighter.PowerUp(powerUp);

            Assert.AreEqual(1, fighter.Damage);
        }
        public void DrinkPotion_ShouldSetStateToHealthy_WhenHealthHitsMaximum()
        {
            var fighter       = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();
            var potion        = FightClubGame.PurchasePotion();

            fighter.TakeDamage(secondFighter);
            fighter.DrinkPotion(potion);

            Assert.AreEqual(FighterState.Healthy, fighter.State);
        }
        public void DrinkPotion_ShouldNeverHealBeyondMaxHealth()
        {
            var fighter       = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();
            var potion        = FightClubGame.PurchasePotion();

            fighter.TakeDamage(secondFighter);
            fighter.DrinkPotion(potion);

            Assert.AreEqual(10, fighter.Health);
        }
        public void TakeDamage_WillSetStateToDead_WhenHealthIsZero()
        {
            var firstFighter  = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();

            for (int i = 1; i <= 10; i++)
            {
                firstFighter.TakeDamage(secondFighter);
            }

            Assert.AreEqual(FighterState.Dead, firstFighter.State);
        }
        public void TakeDamage_WillSetStateToKnockedOut_WhenHealthIsOne()
        {
            var firstFighter  = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();

            for (int i = 1; i <= 9; i++)
            {
                firstFighter.TakeDamage(secondFighter);
            }

            Assert.AreEqual(FighterState.KnockedOut, firstFighter.State);
        }
        public void TakeDamage_WillSetStateToHurt_WhenHealthIsTwoToAndIncludingTen()
        {
            var firstFighter  = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();

            for (int i = 1; i <= 8; i++)
            {
                firstFighter.TakeDamage(secondFighter);

                Assert.AreEqual(FighterState.Hurt, firstFighter.State);
            }
        }
        public void TakeDamage_ShouldNotDropHealthBelowZero()
        {
            var firstFighter  = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();

            for (int i = 0; i < 100; i++)
            {
                firstFighter.TakeDamage(secondFighter);
            }

            Assert.AreEqual(0, firstFighter.Health);
        }
Esempio n. 16
0
        public void PowerUp_ShouldReducePowerIfNegative()
        {
            var fighter = FightClubGame.HireFighter();
            var powerUp = FightClubGame.PurchasePowerUp();

            powerUp.DamageBuff = 1;

            fighter.PowerUp(powerUp);

            powerUp.DamageBuff = -1;

            fighter.PowerUp(powerUp);

            Assert.AreEqual(1, fighter.Damage);
        }
        public void DrinkPotion_ShouldNotChangeState_WhenHealthIsZero()
        {
            var fighter       = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();
            var potion        = FightClubGame.PurchasePotion();

            for (int i = 1; i <= 100; i++)
            {
                fighter.TakeDamage(secondFighter);
            }

            fighter.DrinkPotion(potion);

            Assert.AreEqual(FighterState.Dead, fighter.State);
        }
        public void DrinkPotion_ShouldSetStateToHurtFromKnockedOut()
        {
            var fighter       = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();
            var potion        = FightClubGame.PurchasePotion();

            for (int i = 1; i <= 9; i++)
            {
                fighter.TakeDamage(secondFighter);
            }

            fighter.DrinkPotion(potion);

            Assert.AreEqual(FighterState.Hurt, fighter.State);
        }
        public void DrinkPotion_ShouldIncreaseHealthBasedUponValueOfPotion_WhenNewValueIsNotBeyondMaximum()
        {
            var fighter       = FightClubGame.HireFighter();
            var secondFighter = FightClubGame.HireFighter();
            var potion        = FightClubGame.PurchasePotion();

            for (int i = 1; i <= 5; i++)
            {
                fighter.TakeDamage(secondFighter);
            }

            fighter.DrinkPotion(potion);

            Assert.AreEqual(7, fighter.Health);
        }
Esempio n. 20
0
        public void PurchasePowerUp_ShouldReturnObjectWithDefaultValues()
        {
            var powerUp = FightClubGame.PurchasePowerUp();

            Assert.AreEqual(1, powerUp.DamageBuff);
        }