Exemplo n.º 1
0
        public void When_It_Is_CounterAttack_By_A_Unit_With_Attack_Greater_Than_Its_Defense()
        {
            StartGame(DeckList);
            var debug10001000 = (Unit)Player.Hand[1];

            Play.Deploy(Player.Id, debug10001000.Id);
            Play.PassPlay(Opponent.Id);
            Play.PassPlay(Player.Id);
            Assert.IsTrue(Player.Field.Contains(debug10001000), "Weaking Deployed");
            Play.EndTurn(Player.Id);
            var debug15001000 = (Unit)Opponent.Hand[Opponent.Hand.Count - 1];

            Play.Deploy(Opponent.Id, debug15001000.Id);
            Play.PassPlay(Player.Id);
            Play.PassPlay(Opponent.Id);
            Assert.IsTrue(Opponent.Field.Contains(debug15001000), "Defender Deployed");
            Play.EndTurn(Opponent.Id);
            var difference   = debug15001000.Power - debug10001000.Power;
            var expectedLife = Player.Health - difference;

            Play.Attack(Player.Id, debug10001000.Id, debug15001000.Id);
            Play.PassPlay(Opponent.Id);
            Play.PassPlay(Player.Id);

            Assert.Contains(debug10001000, Player.Graveyard, "Then it is destroyed");
            Assert.IsEqual(expectedLife, Player.Health,
                           "Then the attacking Player loses life equal to the difference");
        }
Exemplo n.º 2
0
        public void That_Adds_A_Tag_To_Players_When_Unit_Card_Is_Played()
        {
            // Battle is not implemented currently so this fails
            DeckList.Add(SetCodes.DebugPlayerCannotTakeDamage);
            StartGame(DeckList);

            var preventDamage = Opponent.Hand[0];
            var debug500500   = Opponent.Hand[4];
            var debug15001000 = Player.Hand[1];

            Play.Deploy(Player.Id, debug15001000.Id);
            Play.PassPlay(Opponent.Id);
            Play.PassPlay(Player.Id);
            Play.EndTurn(Player.Id);
            Play.Deploy(Opponent.Id, debug500500.Id);
            Play.PassPlay(Player.Id);
            Play.PassPlay(Opponent.Id);
            Play.Deploy(Opponent.Id, preventDamage.Id);
            Play.PassPlay(Player.Id);
            Play.PassPlay(Opponent.Id);
            Play.EndTurn(Opponent.Id);
            var life = Opponent.Health;

            Play.Attack(Player.Id, debug15001000.Id, debug500500.Id);
            Play.PassPlay(Opponent.Id);
            Play.PassPlay(Player.Id);

            Assert.IsTrue(Opponent.HasTag(TagIds.CannotTakeBattleDamage), "Defending Player has Tag.CannotTakeDamage");
            Assert.IsEqual(life, Opponent.Health, "Player's life did not change");
            Assert.Contains(debug500500, Opponent.Graveyard, "But the defending unit was still destroyed");
        }
Exemplo n.º 3
0
        public void When_Its_Attack_Is_Greater_Than_The_Defending_Units_Defense()
        {
            StartGame(DeckList);

            var debug15001000 = (Unit)Player.Hand[Player.Hand.Count - 1];

            Play.Deploy(Player.Id, debug15001000.Id);
            Play.PassPlay(Opponent.Id);
            Play.PassPlay(Player.Id);
            Play.EndTurn(Player.Id);
            var debug10001000 = (Unit)Opponent.Hand[1];

            Play.Deploy(Opponent.Id, debug10001000.Id);
            Play.PassPlay(Player.Id);
            Play.PassPlay(Opponent.Id);
            Play.EndTurn(Opponent.Id);
            Play.Attack(Player.Id, debug15001000.Id, debug10001000.Id);
            Play.PassPlay(Opponent.Id);
            Play.PassPlay(Player.Id);
            var difference   = debug15001000.Power - debug10001000.Power;
            var expectedLife = Player.Health - difference;

            Assert.Contains(debug10001000, Opponent.Graveyard, "Then the defending unit is destroyed");
            Assert.IsEqual(expectedLife, Opponent.Health,
                           "Then the defending Players loses life equal to the difference");
        }
Exemplo n.º 4
0
        public void When_They_Declare_An_Attack_Against_A_Unit_Not_On_Their_Opponents_Field()
        {
            StartGame(DeckList);
            var unit = Player.Hand[0].Id;

            Play.Deploy(Player.Id, unit);
            Play.EndTurn(Player.Id);
            Play.EndTurn(Opponent.Id);
            var attackTarget = Opponent.Hand[0].Id;

            Play.Attack(Player.Id, unit, attackTarget);

            Assert.IsTrue(Player.IsDisqualified);
        }