diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java index 3293ebacf13..3b73418f9d8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java @@ -18,7 +18,7 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { /** * Checks if control has changed and the controlled creature has Haste - * + * */ @Test public void testPermanentControlEffect() { @@ -39,13 +39,12 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { } /** - * I gained control of my opponent's Glen Elendra Archmage with Vedalken Shackles. - * After I sacrificed it to counter a spell, it Persisted back to my battlefield, - * but it should return under its owner's control. Maybe a Persist problem, but I - * am thinking Vedalken Shackles doesn't realize that it is a different object - * when it returns from the graveyard instead. + * I gained control of my opponent's Glen Elendra Archmage with Vedalken + * Shackles. After I sacrificed it to counter a spell, it Persisted back to + * my battlefield, but it should return under its owner's control. Maybe a + * Persist problem, but I am thinking Vedalken Shackles doesn't realize that + * it is a different object when it returns from the graveyard instead. */ - @Test public void testGainControlOfCreatureWithPersistEffect() { // {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped. @@ -60,7 +59,7 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { // Persist (When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.) addCard(Zone.BATTLEFIELD, playerB, "Glen Elendra Archmage"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped.","Glen Elendra Archmage"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped.", "Glen Elendra Archmage"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Strike", playerA); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{U},Sacrifice {this}: Counter target noncreature spell.", "Lightning Strike"); @@ -76,4 +75,33 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Glen Elendra Archmage", 1); } + + /** + * The shackles can maintain control of Mutavault indefinitely, even when + * it's not a creature. + * + */ + @Test + public void testKeepControlOfMutavault() { + // {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped. + addCard(Zone.BATTLEFIELD, playerA, "Vedalken Shackles", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + // {T}: Add {1} to your mana pool. + // {1}: Mutavault becomes a 2/2 creature with all creature types until end of turn. It's still a land. + addCard(Zone.BATTLEFIELD, playerB, "Mutavault", 1); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: Until end of turn {this} becomes"); + activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2},{T}: Gain control", "Mutavault"); + + setChoice(playerA, "No"); // Don't untap the Shackles + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + // under control of Shackles even if it's no longer a creature + assertPermanentCount(playerB, "Mutavault", 0); + assertPermanentCount(playerA, "Mutavault", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index 1114d2d0732..f438ff6ed50 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -574,7 +574,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Battlefield) Card counts for " + player.getName() + " are not equal (" + cardName + ")", count, actualCount); } @Override