From 5af4942d15775ccb832c73a961dac043faa793aa Mon Sep 17 00:00:00 2001 From: Patrick Hulin Date: Mon, 9 Dec 2019 14:15:56 -0500 Subject: [PATCH] Add test for copying and more test comments. --- .../cost/adventure/AdventureCardsTest.java | 77 ++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java index a286010588..81ffca8039 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java @@ -8,6 +8,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class AdventureCardsTest extends CardTestPlayerBase { @Test public void testCastTreatsToShare() { + /* + * Curious Pair {1}{G} + * Creature — Human Peasant + * 1/3 + * ---- + * Treats to Share {G} + * Sorcery — Adventure + * Create a Food token. + */ setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, "Forest"); addCard(Zone.HAND, playerA, "Curious Pair"); @@ -59,6 +68,12 @@ public class AdventureCardsTest extends CardTestPlayerBase { @Test public void testCastTreatsToShareWithEdgewallInnkeeper() { + /* + * Edgewall Innkeeper {G} + * Creature — Human Peasant + * Whenever you cast a creature spell that has an Adventure, draw a card. + * 1/1 + */ setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, "Forest"); addCard(Zone.BATTLEFIELD, playerA, "Forest"); @@ -116,12 +131,17 @@ public class AdventureCardsTest extends CardTestPlayerBase { @Test public void testCastMemoryTheft() { + /* + * Memory Theft {2}{B} + * Sorcery + * Target opponent reveals their hand. You choose a nonland card from it. That player discards that card. + * You may put a card that has an Adventure that player owns from exile into that player's graveyard. + */ setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, "Forest"); addCard(Zone.HAND, playerA, "Curious Pair"); addCard(Zone.HAND, playerA, "Opt"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); addCard(Zone.BATTLEFIELD, playerB, "Swamp"); addCard(Zone.BATTLEFIELD, playerB, "Swamp"); @@ -130,11 +150,66 @@ public class AdventureCardsTest extends CardTestPlayerBase { castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Memory Theft", playerA); playerB.addChoice("Opt"); playerB.addChoice("Curious Pair"); + setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); + assertHandCount(playerA, 0); assertExileCount(playerA, "Curious Pair", 0); assertGraveyardCount(playerA, 2); assertAllCommandsUsed(); } + + @Test + public void testCastTreatsToShareWithLuckyClover() { + /* + * Lucky Clover {2} + * Artifact + * Whenever you cast an Adventure instant or sorcery spell, copy it. You may choose new targets for the copy. + */ + setStrictChooseMode(true); + addCard(Zone.BATTLEFIELD, playerA, "Forest"); + addCard(Zone.BATTLEFIELD, playerA, "Lucky Clover"); + addCard(Zone.HAND, playerA, "Curious Pair"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, 0); + assertPermanentCount(playerA, "Food", 2); + assertPermanentCount(playerA, "Curious Pair", 0); + assertExileCount(playerA, "Curious Pair", 1); + assertGraveyardCount(playerA, 0); + assertAllCommandsUsed(); + } + + @Test + public void testCastTreatsToShareAndCopy() { + /* + * Fork {R}{R} + * Instant + * Copy target instant or sorcery spell, except that the copy is red. You may choose new targets for the copy. + */ + setStrictChooseMode(true); + addCard(Zone.BATTLEFIELD, playerA, "Forest"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain"); + addCard(Zone.HAND, playerA, "Curious Pair"); + addCard(Zone.HAND, playerA, "Fork"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fork", "Treats to Share"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, 0); + assertPermanentCount(playerA, "Food", 2); + assertPermanentCount(playerA, 5); + assertExileCount(playerA, "Curious Pair", 1); + assertExileCount(playerA, 1); + assertGraveyardCount(playerA, "Fork", 1); + assertGraveyardCount(playerA, 1); + assertAllCommandsUsed(); + } }