From 75d0926f4b2d1684909e2fc04ba8ba003f30e47b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 3 Jun 2020 18:06:03 +0200 Subject: [PATCH] * Some minor changes. --- .../src/mage/cards/n/NacatlWarPride.java | 2 +- .../cards/copy/VolrathsShapshifterTest.java | 63 ++++++++++--------- .../duel/MairsilThePretenderTest.java | 4 +- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/NacatlWarPride.java b/Mage.Sets/src/mage/cards/n/NacatlWarPride.java index 3bc52a35f60..514b256315a 100644 --- a/Mage.Sets/src/mage/cards/n/NacatlWarPride.java +++ b/Mage.Sets/src/mage/cards/n/NacatlWarPride.java @@ -63,7 +63,7 @@ class NacatlWarPrideEffect extends OneShotEffect { public NacatlWarPrideEffect() { super(Outcome.Benefit); - this.staticText = "create X tokens that are copies of Nacatl War-Pride tapped and attacking, where X is the number of creatures defending player controls. Exile the tokens at the beginning of the next end step."; + this.staticText = "create X tokens that are copies of {this} tapped and attacking, where X is the number of creatures defending player controls. Exile the tokens at the beginning of the next end step"; } public NacatlWarPrideEffect(final NacatlWarPrideEffect effect) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/VolrathsShapshifterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/VolrathsShapshifterTest.java index d8f4d44902c..c985c484933 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/VolrathsShapshifterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/VolrathsShapshifterTest.java @@ -16,11 +16,11 @@ import org.mage.test.serverside.base.CardTestPlayerBase; /** * Volrath's Shapeshifter - * - * As long as the top card of your graveyard is a creature card, - * Volrath's Shapeshifter has the full text of that card and has the - * text "2: Discard a card." (Volrath's Shapeshifter has that card's name, - * mana cost, color, types, abilities, power, and toughness.) + * + * As long as the top card of your graveyard is a creature card, Volrath's + * Shapeshifter has the full text of that card and has the text "2: Discard a + * card." (Volrath's Shapeshifter has that card's name, mana cost, color, types, + * abilities, power, and toughness.) * */ public class VolrathsShapshifterTest extends CardTestPlayerBase { @@ -36,9 +36,11 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerA, "Assault Griffin", 1); addCard(Zone.LIBRARY, playerA, "Forest", 1); skipInitShuffling(); - + setStopAt(1, PhaseStep.END_TURN); - execute(); + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); assertPermanentCount(playerA, "Assault Griffin", 1); assertPowerToughness(playerA, "Assault Griffin", 3, 2); @@ -48,12 +50,13 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase { Assert.assertTrue("Volrath's Shapeshifter must have flying", shapeshifter.getAbilities().contains(FlyingAbility.getInstance())); Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter)); } - + /** - * Tests turing back into Volrath's Shapeshifter after a new card is put on top that isn't a creature + * Tests turing back into Volrath's Shapeshifter after a new card is put on + * top that isn't a creature */ @Test - public void testLosingCopy() { + public void testLosingCopy() { addCard(Zone.BATTLEFIELD, playerA, "Volrath's Shapeshifter", 1); // Codex Shredder - Artifact // {T}: Target player puts the top card of their library into their graveyard. @@ -68,7 +71,9 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Target player puts the top card of their library into their graveyard.", playerA); setStopAt(1, PhaseStep.END_TURN); - execute(); + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); assertPermanentCount(playerA, "Volrath's Shapeshifter", 1); assertPowerToughness(playerA, "Volrath's Shapeshifter", 0, 1); @@ -77,25 +82,27 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase { Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains(SubType.SHAPESHIFTER)); Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter)); } - + @Test public void testControlChange() { addCard(Zone.BATTLEFIELD, playerA, "Island", 5); addCard(Zone.HAND, playerA, "Mind Control", 1); - addCard(Zone.LIBRARY, playerA, "Forest", 1); addCard(Zone.GRAVEYARD, playerA, "Dutiful Thrull", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Volrath's Shapeshifter", 1); addCard(Zone.GRAVEYARD, playerB, "Assault Griffin", 1); - + skipInitShuffling(); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind Control", "Assault Griffin"); - + setStopAt(1, PhaseStep.END_TURN); - execute(); + + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); assertPermanentCount(playerA, "Dutiful Thrull", 1); assertPowerToughness(playerA, "Dutiful Thrull", 1, 1); @@ -103,20 +110,18 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase { Permanent shapeshifter = getPermanent("Dutiful Thrull", playerA.getId()); Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains(SubType.THRULL)); Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter)); - - } - + private boolean hasShapeshiftersOriginalAbility(Permanent shapeshifter) { for (Ability ability : shapeshifter.getAbilities()) { - if(ability instanceof SimpleActivatedAbility) { - SimpleActivatedAbility simpleActivatedAbility = (SimpleActivatedAbility)ability; - return simpleActivatedAbility.getZone() == Zone.BATTLEFIELD && simpleActivatedAbility.getEffects().size() == 1 && - simpleActivatedAbility.getEffects().get(0) instanceof DiscardControllerEffect && simpleActivatedAbility.getManaCosts().size() == 1 - && simpleActivatedAbility.getManaCosts().get(0) instanceof GenericManaCost && simpleActivatedAbility.getManaCosts().get(0).convertedManaCost() == 2; - } - } - + if (ability instanceof SimpleActivatedAbility) { + SimpleActivatedAbility simpleActivatedAbility = (SimpleActivatedAbility) ability; + return simpleActivatedAbility.getZone() == Zone.BATTLEFIELD && simpleActivatedAbility.getEffects().size() == 1 + && simpleActivatedAbility.getEffects().get(0) instanceof DiscardControllerEffect && simpleActivatedAbility.getManaCosts().size() == 1 + && simpleActivatedAbility.getManaCosts().get(0) instanceof GenericManaCost && simpleActivatedAbility.getManaCosts().get(0).convertedManaCost() == 2; + } + } + return false; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/MairsilThePretenderTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/MairsilThePretenderTest.java index d9e53707759..786be26818f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/MairsilThePretenderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/MairsilThePretenderTest.java @@ -38,7 +38,9 @@ public class MairsilThePretenderTest extends CardTestCommanderDuelBase { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); addCard(Zone.BATTLEFIELD, playerA, "Island", 2); - + addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 3); + skipInitShuffling(); + // Enchant creature // Enchanted creature has haste and “At the beginning of your upkeep, destroy this creature. // Reveal cards from the top of your library until you reveal a creature card.