diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java new file mode 100644 index 00000000000..d4bbf56c9af --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java @@ -0,0 +1,41 @@ +package org.mage.test.cards.abilities.enters; + +import junit.framework.Assert; +import mage.Constants; +import mage.game.permanent.Permanent; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author noxx + */ +public class ProteanHydraTest extends CardTestPlayerBase { + + @Test + public void testEnteringWithCounters() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Constants.Zone.HAND, playerA, "Protean Hydra"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Protean Hydra"); + + setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) { + if (permanent.getName().equals("Forest")) { + // check all mana was spent + Assert.assertTrue(permanent.isTapped()); + } + } + + assertPermanentCount(playerA, "Protean Hydra", 1); + + Permanent proteanHydra = getPermanent("Protean Hydra", playerA.getId()); + Assert.assertEquals(4, proteanHydra.getPower().getValue()); + Assert.assertEquals(4, proteanHydra.getToughness().getValue()); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java new file mode 100644 index 00000000000..c281d0432ba --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java @@ -0,0 +1,39 @@ +package org.mage.test.cards.conditional.twofaced; + +import junit.framework.Assert; +import mage.Constants; +import mage.filter.Filter; +import mage.game.permanent.Permanent; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author noxx + */ +public class TwoFacedCardEffectsTest extends CardTestPlayerBase { + + /** + * Tests that effects disappears when card gets transformed + */ + @Test + public void testEffectTurnedOffOnTransform() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Mayor of Avabruck"); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Wolfir Avenger"); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Elite Inquisitor"); + + setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + // check was transformed + assertPermanentCount(playerA, "Howlpack Alpha", 1); + + // check new effect works + assertPowerToughness(playerA, "Wolfir Avenger", 4, 4, Filter.ComparisonScope.Any); + + // check old effect doesn't work + Permanent eliteInquisitor = getPermanent("Elite Inquisitor", playerA.getId()); + Assert.assertEquals(2, eliteInquisitor.getPower().getValue()); + Assert.assertEquals(2, eliteInquisitor.getToughness().getValue()); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/combat/damage/HuntersInsightTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/combat/damage/HuntersInsightTest.java new file mode 100644 index 00000000000..51d8d381279 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/combat/damage/HuntersInsightTest.java @@ -0,0 +1,35 @@ +package org.mage.test.cards.triggers.combat.damage; + +import mage.Constants; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author noxx + * + * Whenever this creature deals combat damage to a player or planeswalker, draw that many cards. + */ +public class HuntersInsightTest extends CardTestPlayerBase { + + @Test + public void testDrawingCards() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 3); + addCard(Constants.Zone.HAND, playerA, "Hunter's Insight", 1); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Stampeding Rhino", 1); + + attack(3, playerA, "Stampeding Rhino"); + castSpell(3, Constants.PhaseStep.DECLARE_BLOCKERS, playerA, "Hunter's Insight", "Stampeding Rhino"); + + setStopAt(3, Constants.PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 16); + + // +1 in draw phase + // +4 in combat + assertHandCount(playerA, 5); + } + +}