コード例 #1
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);
        }
コード例 #2
0
        public void PowerGenerateMethod_ShouldGenerateAmountOfRagePower_WhenCalled()
        {
            IPower ragePower = PowerFactory.CreateRagePower();
            ISpell spell     = WarriorSpellFactory.CreateBloodLust();

            ragePower.PowerGenerate(spell);

            Assert.AreNotEqual(ragePower.PowerCurr, 0);
        }
コード例 #3
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);
        }
コード例 #4
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);
        }
コード例 #5
0
        public void PowerConsumeMethod_ShouldConsumeAmountOfRagePower_WhenCalled()
        {
            IPower ragePower = PowerFactory.CreateRagePower();

            ragePower.PowerCurr = 100;
            ISpell spell = WarriorSpellFactory.CreateMortalStrike();

            spell.PowerCost = 50;

            ragePower.PowerConsume(spell);

            Assert.AreEqual(ragePower.PowerCurr, 50);
        }
コード例 #6
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);
        }
コード例 #7
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);
        }
コード例 #8
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);
        }
コード例 #9
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);
        }