コード例 #1
0
        public void BaronRivendare()
        {
            var baron = HearthEntityFactory.CreateCard <BaronRivendare>();

            var playerAbom = HearthEntityFactory.CreateCard <Abomination>();

            playerAbom.CurrentManaCost = 0;

            var opponentAbom = HearthEntityFactory.CreateCard <Abomination>();

            opponentAbom.TakeBuff(0, 10); // Just so it doesn't die to double player abom deathrattle
            opponentAbom.ApplyStatusEffects(MinionStatusEffects.CHARGE);
            opponentAbom.CurrentManaCost = 0;

            GameEngine.GameState.CurrentPlayerPlayZone[0] = baron;

            player.AddCardToHand(playerAbom);
            opponent.AddCardToHand(opponentAbom);

            player.PlayCard(playerAbom, null);

            GameEngine.EndTurn();

            // Kill the player Abom which should trigger its deathrattle twice doing 4 damage to everybody
            opponent.PlayCard(opponentAbom, null);
            opponentAbom.Attack(playerAbom);

            Assert.AreEqual(baron.MaxHealth - 4, baron.CurrentHealth, "Verify baron got hit by deathrattle twice");
            Assert.AreEqual(6, opponentAbom.CurrentHealth, "Verify opponent abom took 4 damage from retaliation and 4 from double deathrattle");
        }
コード例 #2
0
        public void BloodImp()
        {
            var imp = HearthEntityFactory.CreateCard <BloodImp>();

            imp.CurrentManaCost = 0;

            var yeti   = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var faerie = HearthEntityFactory.CreateCard <FaerieDragon>();

            player.AddCardToHand(imp);
            player.PlayCard(imp, null);

            GameEngine.EndTurn();

            Assert.AreEqual(1, imp.MaxHealth, "Verify imp didn't buff itself");

            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti;
            GameEngine.GameState.CurrentPlayerPlayZone[1] = faerie;

            GameEngine.EndTurn();
            GameEngine.EndTurn();

            if (yeti.MaxHealth != 6 && faerie.MaxHealth != 3)
            {
                Assert.Fail("No other minion got bonus health.");
            }
        }
コード例 #3
0
        public void AlarmoBotSummonNoBattlecry()
        {
            var alarmo = HearthEntityFactory.CreateCard <AlarmoBot>();

            alarmo.CurrentManaCost = 0;
            alarmo.Owner           = player;

            var azureDrake = HearthEntityFactory.CreateCard <AzureDrake>();

            player.AddCardsToHand(new List <BaseCard>()
            {
                alarmo, azureDrake
            });

            player.PlayCard(alarmo, null);

            GameEngine.EndTurn();

            var handSize = player.Hand.Count;

            GameEngine.EndTurn();

            Assert.IsTrue(GameEngine.GameState.CurrentPlayerPlayZone.Contains(azureDrake), "Verify azure drake was summoned");
            Assert.IsTrue(player.Hand.Count < handSize + 2, "Verify an extra card wasn't drawn from azure drake being summoned");
        }
コード例 #4
0
        public void BasicWeaponsAttacking()
        {
            var warAxe = HearthEntityFactory.CreateCard <FieryWarAxe>();

            player.Weapon      = warAxe;
            warAxe.WeaponOwner = player;

            var yeti = HearthEntityFactory.CreateCard <ChillwindYeti>();

            GameEngine.GameState.WaitingPlayerPlayZone[0] = yeti;

            player.Attack(yeti);
            Assert.AreEqual(2, yeti.CurrentHealth, "Verify Yeti_1 is at 2 health");
            Assert.AreEqual(26, player.Health, "Verify the player is now at 26 health");
            Assert.AreEqual(1, warAxe.Durability, "Verify the war axe is now at 1 durability");

            player.RemoveStatusEffects(PlayerStatusEffects.EXHAUSTED);

            player.Attack(yeti);
            Assert.AreEqual(-1, yeti.CurrentHealth, "Verify Yeti_1 is at -1 health");
            Assert.AreEqual(22, player.Health, "Verify the player is now at 22 health");
            Assert.AreEqual(0, warAxe.Durability, "Verify the war axe is now at 0 durability");

            Assert.IsNull(player.Weapon, "Verify that the player no longer has the weapon equipped");
            Assert.IsTrue(player.Graveyard.Contains(warAxe), "Verify that the war axe is now in the graveyard");
        }
コード例 #5
0
        public void DeathRattleReturnFriendlyMinion()
        {
            var ambusher = HearthEntityFactory.CreateCard <AnubarAmbusher>();

            ambusher.Owner           = player;
            ambusher.CurrentManaCost = 0;

            var yeti   = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var faerie = HearthEntityFactory.CreateCard <FaerieDragon>();
            var giant  = HearthEntityFactory.CreateCard <SeaGiant>();

            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti;
            GameEngine.GameState.CurrentPlayerPlayZone[1] = faerie;
            GameEngine.GameState.WaitingPlayerPlayZone[0] = giant;

            player.AddCardToHand(ambusher);

            player.PlayCard(ambusher, null);

            GameEngine.EndTurn();
            giant.Attack(ambusher);

            // Ambusher should die and return a random friendly minion back to the owner's hand
            Assert.IsTrue(GameEngine.DeadCardsThisTurn.Contains(ambusher), "Verify ambusher died");
            Assert.IsTrue(player.Hand.Contains(yeti) || player.Hand.Contains(faerie), "Verify minion returned to hand");
        }
コード例 #6
0
        public void DeathrattleDamageAllMinions()
        {
            var yeti1 = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var yeti2 = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var yeti3 = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var yeti4 = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var abom1 = HearthEntityFactory.CreateCard <Abomination>();

            abom1.CurrentManaCost = 0;
            player.AddCardToHand(abom1);

            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti1;
            GameEngine.GameState.CurrentPlayerPlayZone[1] = yeti2;
            GameEngine.GameState.WaitingPlayerPlayZone[0] = yeti3;
            GameEngine.GameState.WaitingPlayerPlayZone[1] = yeti4;

            player.PlayCard(abom1, null);

            GameEngine.EndTurn();

            // This should kill the abomination
            // The yeti should also die from the deathrattle
            yeti3.Attack(abom1);

            // The rest of the yetis should have taken 2 damage from the abom deathrattle
            Assert.IsTrue(GameEngine.DeadCardsThisTurn.Contains(abom1));
            Assert.IsTrue(GameEngine.DeadCardsThisTurn.Contains(yeti3));
            Assert.AreEqual(3, yeti1.CurrentHealth, "Verify that the other yetis are hurt from the deathrattle");
            Assert.AreEqual(3, yeti2.CurrentHealth, "Verify that the other yetis are hurt from the deathrattle");
            Assert.AreEqual(3, yeti4.CurrentHealth, "Verify that the other yetis are hurt from the deathrattle");
        }
コード例 #7
0
        public void DeathrattleHealTargetWithAuchenai()
        {
            var chow = HearthEntityFactory.CreateCard <ZombieChow>();

            chow.CurrentManaCost = 0;

            var auchenai = HearthEntityFactory.CreateCard <AuchenaiSoulpriest>();

            auchenai.CurrentManaCost = 0;

            var giant = HearthEntityFactory.CreateCard <SeaGiant>();

            GameEngine.GameState.WaitingPlayerPlayZone[0] = giant;

            player.AddCardToHand(chow);
            player.PlayCard(chow, null);

            player.AddCardToHand(auchenai);
            player.PlayCard(auchenai, null);

            GameEngine.EndTurn();

            int startingHealth = 10;

            opponent.Health = startingHealth;

            giant.Attack(chow);

            Assert.AreEqual(startingHealth - ZombieChow.DEATHRATTLE_POWER, opponent.Health, "Verify opponent got damaged");
        }
コード例 #8
0
ファイル: SpellTests.cs プロジェクト: carlosf/HearthAnalyzer
        public void BonusSpellPower()
        {
            var ancientMage = HearthEntityFactory.CreateCard <AncientMage>();

            ancientMage.Owner           = player;
            ancientMage.CurrentManaCost = 0;

            var yeti       = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var azureDrake = HearthEntityFactory.CreateCard <AzureDrake>();

            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti;
            GameEngine.GameState.CurrentPlayerPlayZone[1] = azureDrake;

            player.AddCardToHand(ancientMage);
            player.PlayCard(ancientMage, null, 1);

            // Yeti should have +1 SP and Azure Drake should have +2
            Assert.AreEqual(1, yeti.BonusSpellPower, "Verify yeti bonus spell power");
            Assert.AreEqual(2, azureDrake.BonusSpellPower, "Verify azure drake bonus spell power");
            Assert.AreEqual(3, player.BonusSpellPower, "Verify player's bonus spell power");

            var fireball = HearthEntityFactory.CreateCard <Fireball>();

            fireball.Owner           = player;
            fireball.CurrentManaCost = 0;

            player.AddCardToHand(fireball);

            // Fireball should do 6 + 3 damage
            player.PlayCard(fireball, opponent);
            Assert.AreEqual(21, opponent.Health, "Verify the opponent took 9 points of damage");
        }
コード例 #9
0
ファイル: SpellTests.cs プロジェクト: carlosf/HearthAnalyzer
        public void CircleOfHealing()
        {
            var circleOfHealing = HearthEntityFactory.CreateCard <CircleofHealing>();

            circleOfHealing.CurrentManaCost = 0;

            var playerYeti = HearthEntityFactory.CreateCard <ChillwindYeti>();

            playerYeti.BonusSpellPower = 1;
            playerYeti.MaxHealth       = 10;
            playerYeti.CurrentHealth   = 1;

            var opponentYeti = HearthEntityFactory.CreateCard <ChillwindYeti>();

            opponentYeti.MaxHealth     = 10;
            opponentYeti.CurrentHealth = 1;

            GameEngine.GameState.CurrentPlayerPlayZone[0] = playerYeti;
            GameEngine.GameState.WaitingPlayerPlayZone[0] = opponentYeti;

            player.AddCardToHand(circleOfHealing);
            player.PlayCard(circleOfHealing, null);

            // Circle of healing shouldn't be affected by spell power so it should just heal for 4
            Assert.AreEqual(5, playerYeti.CurrentHealth, "Verify player yeti was healed");
            Assert.AreEqual(5, opponentYeti.CurrentHealth, "Verify opponent yeti was healed");
        }
コード例 #10
0
        public void AbusiveSergeant()
        {
            var sergeant = HearthEntityFactory.CreateCard <AbusiveSergeant>();
            var faerie   = HearthEntityFactory.CreateCard <FaerieDragon>();
            var yeti     = HearthEntityFactory.CreateCard <ChillwindYeti>();

            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti;
            GameEngine.GameState.WaitingPlayerPlayZone[0] = faerie;

            // Verify buffing friendly minion
            sergeant.CurrentManaCost = 0;
            player.AddCardToHand(sergeant);
            player.PlayCard(sergeant, yeti);

            Assert.AreEqual(yeti.OriginalAttackPower + 2, yeti.CurrentAttackPower, "Verify yeti got an attack buff");

            // Verify buffing enemy minion
            player.AddCardToHand(sergeant);
            player.PlayCard(sergeant, faerie);

            Assert.AreEqual(faerie.OriginalAttackPower + 2, faerie.CurrentAttackPower, "Verify faerie got an attack buff");

            // Verify can't buff players
            player.AddCardToHand(sergeant);
            try
            {
                player.PlayCard(sergeant, player);
                Assert.Fail("Shouldn't be able to buff player!");
            }
            catch (InvalidOperationException)
            {
            }
        }
コード例 #11
0
        public void BloodKnight()
        {
            var bloodKnight = HearthEntityFactory.CreateCard <BloodKnight>();

            bloodKnight.CurrentManaCost = 0;

            // No divine shields
            player.AddCardToHand(bloodKnight);
            player.PlayCard(bloodKnight, null);

            Assert.AreEqual(Cards.Minions.BloodKnight.ATTACK_POWER, bloodKnight.CurrentAttackPower, "Verify attack unchanged");
            Assert.AreEqual(Cards.Minions.BloodKnight.HEALTH, bloodKnight.MaxHealth, "Verify health unchanged");

            GameEngine.GameState.Board.RemoveCard(bloodKnight);
            player.AddCardToHand(bloodKnight);

            // Multiple divine shields
            var playerArgentSquire   = HearthEntityFactory.CreateCard <ArgentSquire>();
            var opponentArgentSquire = HearthEntityFactory.CreateCard <ArgentSquire>();

            GameEngine.GameState.CurrentPlayerPlayZone[0] = playerArgentSquire;
            GameEngine.GameState.WaitingPlayerPlayZone[0] = opponentArgentSquire;

            player.PlayCard(bloodKnight, null);

            Assert.IsFalse(playerArgentSquire.HasDivineShield, "Verify player argent squire lost divine shield");
            Assert.IsFalse(opponentArgentSquire.HasDivineShield, "Verify opponent argent squire lost divine shield");
            Assert.AreEqual(Cards.Minions.BloodKnight.ATTACK_POWER + 6, bloodKnight.CurrentAttackPower, "Verify bloodknight attack was buffed");
            Assert.AreEqual(Cards.Minions.BloodKnight.HEALTH + 6, bloodKnight.MaxHealth, "Verify bloodknight health was buffed");
        }
コード例 #12
0
        public void BloodsailCorsairTest()
        {
            var bloodsail = HearthEntityFactory.CreateCard <BloodsailCorsair>();

            bloodsail.CurrentManaCost = 0;

            var gorehowl = HearthEntityFactory.CreateCard <Gorehowl>();

            opponent.Weapon      = gorehowl;
            gorehowl.WeaponOwner = opponent;

            player.AddCardToHand(bloodsail);
            player.PlayCard(bloodsail, null);

            Assert.IsNull(opponent.Weapon, "Verify opponent weapon got destroyed");
            Assert.IsTrue(GameEngine.DeadCardsThisTurn.Contains(gorehowl), "Verify gorehowl got destroyed");

            var fieryWarAxe = HearthEntityFactory.CreateCard <FieryWarAxe>();

            opponent.Weapon         = fieryWarAxe;
            fieryWarAxe.WeaponOwner = opponent;

            GameEngine.GameState.Board.RemoveCard(bloodsail);
            player.AddCardToHand(bloodsail);

            player.PlayCard(bloodsail, null);

            Assert.AreEqual(FieryWarAxe.DURABILITY - 1, fieryWarAxe.Durability, "Verify fiery war axe lost a durability");
        }
コード例 #13
0
        public void CantAttack()
        {
            GameEngine.GameState.CurrentPlayer = player;

            var ancientWatcher = HearthEntityFactory.CreateCard <AncientWatcher>();

            ancientWatcher.CurrentManaCost = 0;
            ancientWatcher.Owner           = player;

            player.AddCardToHand(ancientWatcher);
            player.PlayCard(ancientWatcher, null);

            GameEngine.EndTurn();
            GameEngine.EndTurn();

            try
            {
                ancientWatcher.Attack(opponent);
                Assert.Fail("Ancient watcher shouldn't be able to attack yet!");
            }
            catch (InvalidOperationException)
            {
            }

            ancientWatcher.Silence();
            ancientWatcher.Attack(opponent);

            Assert.AreEqual(30 - ancientWatcher.CurrentAttackPower, opponent.Health, "Verify opponent got hit");
        }
コード例 #14
0
        public void ChargeAndWindfury()
        {
            var alakir = HearthEntityFactory.CreateCard <AlAkirtheWindlord>();

            alakir.CurrentManaCost = 0;

            GameEngine.GameState.CurrentPlayer = player;
            player.AddCardToHand(alakir);

            player.PlayCard(alakir, null);
            alakir.Attack(opponent);

            Assert.AreEqual(30 - alakir.CurrentAttackPower, opponent.Health, "Verify the opponent took damage");

            alakir.Attack(opponent);
            Assert.AreEqual(30 - (alakir.CurrentAttackPower * 2), opponent.Health, "Verify the opponent got hit again");

            try
            {
                alakir.Attack(opponent);
                Assert.Fail("Alakir shouldn't be able to attack a third time!");
            }
            catch (InvalidOperationException)
            {
            }
        }
コード例 #15
0
        public void Overload()
        {
            player.MaxMana = Constants.MAX_MANA_CAPACITY;
            var stormAxe = HearthEntityFactory.CreateCard <StormforgedAxe>();

            stormAxe.CurrentManaCost = 0;
            player.AddCardToHand(stormAxe);

            GameEngine.GameState.CurrentPlayer = player;
            player.PlayCard(stormAxe, null);

            Assert.AreEqual(stormAxe, player.Weapon, "Verify axe was equipped");
            Assert.AreEqual(1, player.PendingOverload, "Verify player's pending overload");

            GameEngine.EndTurn();
            GameEngine.EndTurn();

            Assert.AreEqual(0, player.PendingOverload, "Verify pending overload is now gone");
            Assert.AreEqual(1, player.Overload, "Verify overload");
            Assert.AreEqual(Constants.MAX_MANA_CAPACITY - 1, player.Mana, "Verify mana less overload");

            GameEngine.EndTurn();
            GameEngine.EndTurn();

            Assert.AreEqual(0, player.Overload, "Verify overload is now gone");
            Assert.AreEqual(Constants.MAX_MANA_CAPACITY, player.Mana, "Verify mana is back to normal");
        }
コード例 #16
0
        public void AncientBrewmaster()
        {
            var brewmaster = HearthEntityFactory.CreateCard <AncientBrewmaster>();

            brewmaster.Owner           = player;
            brewmaster.CurrentManaCost = 0;

            var yeti = HearthEntityFactory.CreateCard <ChillwindYeti>();

            // Verify exception when playing on an empty board with a target
            player.AddCardToHand(brewmaster);

            try
            {
                player.PlayCard(brewmaster, yeti);
                Assert.Fail("Can't play brewmaster on an empty board with a target!");
            }
            catch (InvalidOperationException)
            {
            }
            finally
            {
                GameEngine.GameState.Board.RemoveCard(brewmaster);
                player.AddCardToHand(brewmaster);
            }

            // Verify playing on an empty board with no target is valid
            player.PlayCard(brewmaster, null);

            Assert.IsTrue(GameEngine.GameState.CurrentPlayerPlayZone.Contains(brewmaster), "Verify brewmaster was played");

            GameEngine.GameState.Board.RemoveCard(brewmaster);

            // Verify playing brewmaster returns the friendly minion back to the hand
            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti;

            player.AddCardToHand(brewmaster);
            player.PlayCard(brewmaster, yeti);

            Assert.IsTrue(player.Hand.Contains(yeti), "Verify yeti was returned to the owner's hand");
            Assert.IsFalse(GameEngine.GameState.CurrentPlayerPlayZone.Contains(yeti), "Verify yeti is no longer on the baord");
            Assert.IsTrue(GameEngine.GameState.CurrentPlayerPlayZone.Contains(brewmaster), "Verify brewmaster is on the baord");

            GameEngine.GameState.Board.RemoveCard(brewmaster);

            // Verify playing brewmaster and targeting an enemy minion is not valid
            player.RemoveCardFromHand(yeti);
            GameEngine.GameState.WaitingPlayerPlayZone[0] = yeti;
            player.AddCardToHand(brewmaster);

            try
            {
                player.PlayCard(brewmaster, yeti);
                Assert.Fail("Can't target enemy minions!");
            }
            catch (InvalidOperationException)
            {
            }
        }
コード例 #17
0
        public void AncientMageOnEmptyBoard()
        {
            var mage = HearthEntityFactory.CreateCard <AncientMage>();

            mage.Owner           = player;
            mage.CurrentManaCost = 0;
            player.AddCardToHand(mage);
            player.PlayCard(mage, null);
        }
コード例 #18
0
 private void OnSpellCasting(BaseSpell spell, IDamageableEntity target, out bool shouldAbort)
 {
     if (spell.Owner == this.Owner)
     {
         var fireball = HearthEntityFactory.CreateCard <Fireball> ();
         this.Owner.AddCardToHand(fireball);
     }
     shouldAbort = false;
 }
コード例 #19
0
        public void MinionsAttackingHero()
        {
            var yeti1 = HearthEntityFactory.CreateCard <ChillwindYeti>();

            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti1;

            yeti1.Attack(player);

            Assert.AreEqual(5, yeti1.CurrentHealth, "Verify yeti is at full health");
            Assert.AreEqual(26, player.Health, "Verify the player took damage");
        }
コード例 #20
0
        public void YseraTests()
        {
            var ysera = HearthEntityFactory.CreateCard <Ysera>();

            ysera.CurrentManaCost = 0;

            player.AddCardToHand(ysera);
            player.PlayCard(ysera, null);

            GameEngine.EndTurn();
            Assert.IsTrue(player.Hand.Any(card => ysera.dreamCardTypes.Contains(card.GetType())), "Verify player got a dream card");
        }
コード例 #21
0
        public void AmaniBerserker()
        {
            var amani = HearthEntityFactory.CreateCard <AmaniBerserker>();

            amani.TakeDamage(1);

            Assert.AreEqual(amani.OriginalAttackPower + 3, amani.CurrentAttackPower, "Verify amani is enraged");

            amani.TakeHealing(1);

            Assert.AreEqual(amani.OriginalAttackPower, amani.CurrentAttackPower, "Verify amani chilled out");
        }
コード例 #22
0
        public void UnfreezeMinions()
        {
            GameEngine.GameState.CurrentPlayer = player;

            var playerYeti   = HearthEntityFactory.CreateCard <ChillwindYeti>();
            var playerGolem  = HearthEntityFactory.CreateCard <ArcaneGolem>();
            var playerAlakir = HearthEntityFactory.CreateCard <AlAkirtheWindlord>();
            var opponentYeti = HearthEntityFactory.CreateCard <ChillwindYeti>();

            GameEngine.GameState.CurrentPlayerPlayZone[0] = playerYeti;
            GameEngine.GameState.CurrentPlayerPlayZone[1] = playerGolem;
            GameEngine.GameState.CurrentPlayerPlayZone[2] = playerAlakir;
            GameEngine.GameState.WaitingPlayerPlayZone[0] = opponentYeti;

            playerGolem.Attack(opponent);
            playerAlakir.Attack(opponent);

            playerYeti.ApplyStatusEffects(MinionStatusEffects.FROZEN);
            playerGolem.ApplyStatusEffects(MinionStatusEffects.FROZEN);
            playerAlakir.ApplyStatusEffects(MinionStatusEffects.FROZEN);
            opponentYeti.ApplyStatusEffects(MinionStatusEffects.FROZEN);

            GameEngine.EndTurn();

            // The player's yeti should be unfrozen because it was frozen before it could attack.
            // By definition, freezing means the minion should miss out on an attack so since the
            // yeti didn't attack yet, then it satisfies the requirements to be unfrozen.
            Assert.IsFalse(playerYeti.IsFrozen, "Verify player's yeti is not frozen");

            // This also means that the arcane golem shouldn't be unfrozen because it hasn't missed out on
            // an attack yet since it already attacked this turn
            Assert.IsTrue(playerGolem.IsFrozen, "Verify player's arcane golem is still frozen");

            // Now, if a windfuried minion has already attacked this turn, then it will remain frozen
            Assert.IsTrue(playerAlakir.IsFrozen, "Verify player's alakir is still frozen");

            // On the other hand, the opponent's should be frozen because it hasn't missed out on an attack yet
            Assert.IsTrue(opponentYeti.IsFrozen, "Verify opponent's yeti is still frozen");

            GameEngine.EndTurn();

            // Now, the opponent's yeti should be unfrozen since it has missed out on an attack
            Assert.IsFalse(opponentYeti.IsFrozen);

            Assert.IsTrue(playerGolem.IsFrozen, "Verify player's arcane golem is still frozen");
            Assert.IsTrue(playerAlakir.IsFrozen, "Verify player's alakir is still frozen");

            GameEngine.EndTurn();

            // Now, the arcane golem and alakir should finally be unfrozen because it has missed out on an attack
            Assert.IsFalse(playerGolem.IsFrozen, "Verify player's arcane golem is finally unfrozen");
            Assert.IsFalse(playerAlakir.IsFrozen, "Verify player's alakir is finally unfrozen");
        }
コード例 #23
0
        public void AzureDrake()
        {
            var azureDrake = HearthEntityFactory.CreateCard <AzureDrake>();

            azureDrake.CurrentManaCost = 0;

            player.AddCardToHand(azureDrake);
            player.PlayCard(azureDrake, null);

            Assert.AreEqual(1, player.BonusSpellPower, "Verify bonus spell power");
            Assert.AreEqual(29, player.Health, "Verify player drew a fatigue card");
        }
コード例 #24
0
        public void AngryChicken()
        {
            var chicken = HearthEntityFactory.CreateCard <AngryChicken>();

            // Give the chicken some more health so we can enrage it
            chicken.TakeBuff(0, 10);

            chicken.TakeDamage(1);
            Assert.AreEqual(chicken.OriginalAttackPower + 5, chicken.CurrentAttackPower, "Verify attack");

            chicken.TakeHealing(1);
            Assert.AreEqual(chicken.OriginalAttackPower, chicken.CurrentAttackPower, "Verify unenraged chicken");
        }
コード例 #25
0
        public void ArathiWeaponsmith()
        {
            var weaponsmith = HearthEntityFactory.CreateCard <ArathiWeaponsmith>();

            weaponsmith.Owner           = player;
            weaponsmith.CurrentManaCost = 0;

            player.AddCardToHand(weaponsmith);
            player.PlayCard(weaponsmith, null);

            Assert.IsNotNull(player.Weapon, "Verify player has a weapon");
            Assert.IsTrue(player.Weapon is BattleAxe, "Verify the player's weapon is a battle axe");
        }
コード例 #26
0
        public void Battlecry(IDamageableEntity subTarget)
        {
            var battleAxe = HearthEntityFactory.CreateCard <BattleAxe>();

            // kill the old weapon
            if (this.Owner.Weapon != null)
            {
                this.Owner.Weapon.Die();
            }

            this.Owner.Weapon     = battleAxe;
            battleAxe.Owner       = this.Owner;
            battleAxe.WeaponOwner = this.Owner;
        }
コード例 #27
0
        public void StormpikeCommando()
        {
            var commando = HearthEntityFactory.CreateCard <StormpikeCommando>();
            var raptor   = HearthEntityFactory.CreateCard <BloodfenRaptor>();

            GameEngine.GameState.WaitingPlayerPlayZone[0] = raptor;

            player.AddCardToHand(commando);
            commando.CurrentManaCost = 0;

            player.PlayCard(commando, raptor, 0);
            Assert.AreEqual(commando, GameEngine.GameState.Board.PlayerPlayZone[0], "Verify that the commando was placed on the board");
            Assert.IsTrue(GameEngine.DeadCardsThisTurn.Contains(raptor), "Verify the raptor died due to battlecry");
        }
コード例 #28
0
        public void ArcaneGolem()
        {
            var arcaneGolem = HearthEntityFactory.CreateCard <ArcaneGolem>();

            arcaneGolem.CurrentManaCost = 0;
            arcaneGolem.Owner           = player;

            var opponentCurrentMaxMana = opponent.MaxMana;

            player.AddCardToHand(arcaneGolem);
            player.PlayCard(arcaneGolem, null);

            Assert.AreEqual(opponentCurrentMaxMana + 1, opponent.MaxMana, "Verify opponent max mana increased");
        }
コード例 #29
0
        public void AldorPeacekeeper()
        {
            var aldor = HearthEntityFactory.CreateCard <AldorPeacekeeper>();

            aldor.CurrentManaCost = 0;

            var rag = HearthEntityFactory.CreateCard <RagnarostheFirelord>();

            GameEngine.GameState.WaitingPlayerPlayZone[0] = rag;

            player.AddCardToHand(aldor);
            player.PlayCard(aldor, rag);

            Assert.AreEqual(1, rag.CurrentAttackPower, "Verify rag's attack is changed to 1");
        }
コード例 #30
0
        public void ArgentProtector()
        {
            var protector = HearthEntityFactory.CreateCard <ArgentProtector>();

            protector.CurrentManaCost = 0;

            var yeti = HearthEntityFactory.CreateCard <ChillwindYeti>();

            GameEngine.GameState.CurrentPlayerPlayZone[0] = yeti;

            player.AddCardToHand(protector);
            player.PlayCard(protector, yeti);

            Assert.IsTrue(yeti.HasDivineShield, "Verify divine shield");
        }