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 index c281d0432ba..95207375d95 100644 --- 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 @@ -36,4 +36,78 @@ public class TwoFacedCardEffectsTest extends CardTestPlayerBase { Assert.assertEquals(2, eliteInquisitor.getToughness().getValue()); } + /** + * Tests copying card with transform + */ + @Test + public void testCopyCardWithTransform() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 2); + addCard(Constants.Zone.HAND, playerA, "Mayor of Avabruck"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 4); + addCard(Constants.Zone.HAND, playerB, "Clone"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Mayor of Avabruck"); + + castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Clone"); + + setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, 0); + assertHandCount(playerB, 1); + + assertPermanentCount(playerA, "Mayor of Avabruck", 1); + assertPermanentCount(playerB, "Mayor of Avabruck", 1); + } + + /** + * Tests copied card should NOT be possible to transform + */ + @Test + public void testCopyCantTransform() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 2); + addCard(Constants.Zone.HAND, playerA, "Mayor of Avabruck"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 4); + addCard(Constants.Zone.HAND, playerB, "Clone"); + + castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Mayor of Avabruck"); + + castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Clone"); + + setStopAt(5, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, 2); + assertHandCount(playerB, 1); + + // should transform - original + assertPermanentCount(playerA, "Howlpack Alpha", 1); + // should not transform - copy + assertPermanentCount(playerB, "Mayor of Avabruck", 1); + } + + /** + * Tests copying already transformed card + */ + @Test + public void testCopyAlreadyTransformedCard() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Mayor of Avabruck"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 4); + addCard(Constants.Zone.HAND, playerB, "Clone"); + + // copy already transformed + castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Clone"); + + setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, 0); + assertHandCount(playerB, 1); + + // should transform - original + assertPermanentCount(playerA, "Howlpack Alpha", 1); + // check copying card is also transformed + assertPermanentCount(playerB, "Howlpack Alpha", 1); + } + }