Example #1
0
        public void EquipMethod_ShouldEquipItem_WhenCalled()
        {
            IWarriorHero hero           = ClassFactory.CreateWarrior("Hero");
            double       armor          = hero.Armor;
            double       healthCap      = hero.HealthCap;
            double       healthRegen    = hero.HealthRegen;
            int          missChance     = hero.MissChance;
            int          criticalChance = hero.CriticalChance;
            double       criticalDamage = hero.CriticalDamage;

            IEquippable <Item> shoulder = PlateArmorFactory.CreateShoulder("shoulder", 1, 1);

            shoulder.Value     = 300;
            shoulder.Agility   = 30;
            shoulder.Stragiht  = 30;
            shoulder.Intellect = 30;


            hero.Equip(shoulder);


            Assert.IsTrue(
                armor != hero.Armor &&
                healthCap != hero.HealthCap &&
                healthRegen != hero.HealthRegen &&
                missChance != hero.MissChance &&
                criticalChance != hero.CriticalChance &&
                criticalDamage != hero.CriticalDamage);
        }
Example #2
0
        public void IsAliveMethod_ShouldReturnFalseIfCharacterIsDead_WhenCalled()
        {
            // ICharacter dummy = HeroFactory.CreateTestDummy();
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.IsAlive = false;

            Assert.IsFalse(Check.IsAlive(dummy));
        }
Example #3
0
        public void RecklessnessSpell_ShouldGenerateRage_WhenCasted()
        {
            IWarriorHero hero   = ClassFactory.CreateWarrior("test");
            double       amount = hero.Power.PowerCurr;

            hero.Cast(WarriorSpellFactory.CreateRecklessness());

            Assert.AreNotEqual(amount, hero.Power.PowerCurr);
        }
Example #4
0
        public void ElixirOfIntellectObject_ShouldIncreaseIntellectOfHero_WhenUsed()
        {
            IWarriorHero    dummy     = ClassFactory.CreateWarrior("test");
            int             intellect = dummy.Intellect;
            IUseable <Item> elixir    = ElixirFactory.CreateElixirOfIntellect("test", 1, 10);

            dummy.Use(elixir);

            Assert.AreNotEqual(dummy.Intellect, intellect);
        }
Example #5
0
        public void ElixirOfAgilityObject_ShouldIncreaseAgilityOfHero_WhenUsed()
        {
            IWarriorHero    dummy   = ClassFactory.CreateWarrior("test");
            int             agility = dummy.Agility;
            IUseable <Item> elixir  = ElixirFactory.CreateElixirOfAgility("test", 1, 10);

            dummy.Use(elixir);

            Assert.AreNotEqual(dummy.Agility, agility);
        }
Example #6
0
        public void ElixirOfStraightObject_ShouldIncreaseStraightOfHero_WhenUsed()
        {
            IWarriorHero    dummy    = ClassFactory.CreateWarrior("test");
            int             straight = dummy.Straight;
            IUseable <Item> elixir   = ElixirFactory.CreateElixirOfStraight("test", 1, 10);

            dummy.Use(elixir);

            Assert.AreNotEqual(dummy.Straight, straight);
        }
Example #7
0
        public void RecklessnessSpell_ShouldHealHero_WhenCasted()
        {
            IWarriorHero hero = ClassFactory.CreateWarrior("test");

            hero.HealthCurr = 1;
            double health = hero.HealthCurr;

            hero.Cast(WarriorSpellFactory.CreateRecklessness());

            Assert.AreNotEqual(health, hero.HealthCurr);
        }
Example #8
0
        public void HealthPotionObject_ShouldIncreaseHealth_WhenUsed()
        {
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.HealthCurr = 50;
            IUseable <Item> potion = PotionFactory.CreateHealthPotion("test", 1, 50);

            dummy.Use(potion);

            Assert.AreEqual(dummy.HealthCurr, 100);
        }
Example #9
0
        public void BloodLustSpell_ShouldMakeDamage_WhenCasted()
        {
            IWarriorHero hero  = ClassFactory.CreateWarrior("Grommash");
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.MissChance = 0;
            double health = dummy.HealthCurr;

            hero.CastTo(WarriorSpellFactory.CreateBloodLust(), dummy);

            Assert.AreEqual(dummy.HealthCurr, health - WarriorSpellFactory.CreateBloodLust().Value);
        }
Example #10
0
        public void UseMethod_ShouldUseItem_WhenCalled()
        {
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.HealthCurr = 1;
            double          oldHealthCurr = dummy.HealthCurr;
            IUseable <Item> healthPotion  = PotionFactory.CreateHealthPotion("test", 1, 50);

            dummy.Use(healthPotion);

            Assert.AreNotEqual(oldHealthCurr, dummy.HealthCurr);
        }
Example #11
0
        public void MortalStrikeSpell_ShouldMakeDamage_WhenCasted()
        {
            IWarriorHero hero = ClassFactory.CreateWarrior("Grommash");

            hero.Power.PowerCurr = 100;
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.MissChance = 0;
            double health = dummy.HealthCurr;

            hero.CastTo(WarriorSpellFactory.CreateMortalStrike(), dummy);

            Assert.AreEqual(dummy.HealthCurr, health - WarriorSpellFactory.CreateMortalStrike().Value);
        }
Example #12
0
        public void BloodLustSpell_ShouldGenerateRage_WhenCasted()
        {
            IWarriorHero hero   = ClassFactory.CreateWarrior("test");
            double       amount = hero.Power.PowerCurr;

            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.MissChance = 0;


            hero.CastTo(WarriorSpellFactory.CreateBloodLust(), dummy);


            Assert.AreNotEqual(amount, hero.Power.PowerCurr);
        }
Example #13
0
        public void CastToMethod_ShouldMakeDamage_WhenCalled()
        {
            //Arrange
            IWarriorHero attacker = ClassFactory.CreateWarrior("Grommash");
            IWarriorHero attacked = ClassFactory.CreateWarrior("Varian");

            attacked.MissChance = 0;
            double attackedHealth = attacked.HealthCurr;

            //Act
            attacker.CastTo(WarriorSpellFactory.CreateBloodLust(), attacked);

            //Assert
            Assert.AreNotEqual(attackedHealth, attacked.HealthCurr);
        }
Example #14
0
        public void MortalStrikeSpell_ShouldConsumeRage_WhenCasted()
        {
            IWarriorHero hero = ClassFactory.CreateWarrior("test");

            hero.Power.PowerCurr += 100;
            double amount = hero.Power.PowerCurr;

            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.MissChance = 0;


            hero.CastTo(WarriorSpellFactory.CreateMortalStrike(), dummy);


            Assert.AreNotEqual(amount, hero.Power.PowerCurr);
        }
Example #15
0
        public void PlateShoulderObject_ShouldIncreaseStats_WhenEquipped()
        {
            IWarriorHero hero      = ClassFactory.CreateWarrior("Hero");
            int          agility   = hero.Agility;
            int          straight  = hero.Straight;
            int          intellect = hero.Intellect;
            double       armor     = hero.Armor;

            IPlate shoulder = PlateArmorFactory.CreateShoulder("shoulder", 1, 1);

            shoulder.Value     = 1;
            shoulder.Agility   = 1;
            shoulder.Stragiht  = 1;
            shoulder.Intellect = 1;

            hero.Equip(shoulder);

            Assert.IsFalse(
                agility == hero.Agility &&
                straight == hero.Straight &&
                intellect == hero.Intellect &&
                armor == hero.Armor);
        }