コード例 #1
0
ファイル: TestHero.cs プロジェクト: eming44/WOW-Projects
        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);
        }
コード例 #2
0
ファイル: TestChecks.cs プロジェクト: eming44/WOW-Projects
        public void IsAliveMethod_ShouldReturnFalseIfCharacterIsDead_WhenCalled()
        {
            // ICharacter dummy = HeroFactory.CreateTestDummy();
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.IsAlive = false;

            Assert.IsFalse(Check.IsAlive(dummy));
        }
コード例 #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);
        }
コード例 #4
0
ファイル: TestElixirs.cs プロジェクト: eming44/WOW-Projects
        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);
        }
コード例 #5
0
ファイル: TestElixirs.cs プロジェクト: eming44/WOW-Projects
        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);
        }
コード例 #6
0
ファイル: TestElixirs.cs プロジェクト: eming44/WOW-Projects
        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);
        }
コード例 #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);
        }
コード例 #8
0
ファイル: TestPotions.cs プロジェクト: eming44/WOW-Projects
        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);
        }
コード例 #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);
        }
コード例 #10
0
ファイル: TestHero.cs プロジェクト: eming44/WOW-Projects
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #13
0
ファイル: TestHero.cs プロジェクト: eming44/WOW-Projects
        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);
        }
コード例 #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);
        }
コード例 #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);
        }