Consolidate, cleanup & test a few MayCastTargetCardEffect cards

This commit is contained in:
Susucre 2024-04-06 17:37:32 +02:00
parent 68dfcf4eac
commit b233fcf4d8
9 changed files with 173 additions and 214 deletions

View file

@ -6,12 +6,18 @@ import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* {@link mage.cards.g.GaleWaterdeepProdigy Gale, Waterdeep Prodigy} {2}{U}
* Legendary Creature Human Wizard
* Whenever you cast an instant or sorcery spell from your hand, you may cast up to one target card of the other type from your graveyard. If a spell cast from your graveyard this way would be put into your graveyard, exile it instead.
* Choose a Background (You can have a Background as a second commander.)
* 1/3
*
* @author Rjayz
*/
public class GaleWaterdeepProdigyTest extends CardTestPlayerBase {
@Test
public void TestGaleWaterDeepProdigy() {
public void test_GaleWaterDeepProdigy() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 10);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10);

View file

@ -0,0 +1,71 @@
package org.mage.test.cards.single.mbs;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class GalvanothTest extends CardTestPlayerBase {
/**
* {@link mage.cards.g.Galvanoth Galvanoth} {3}{R}{R}
* Creature Beast
* At the beginning of your upkeep, you may look at the top card of your library. You may cast it without paying its mana cost if its an instant or sorcery spell.
* 3/3
*/
private static final String galvanoth = "Galvanoth";
@Test
public void test_Divination_Cast() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Divination");
addCard(Zone.BATTLEFIELD, playerA, galvanoth);
setChoice(playerA, true); // yes to look
setChoice(playerA, true); // yes to cast
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Divination", 1);
assertHandCount(playerA, 2);
}
@Test
public void test_Divination_No_Cast() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Divination");
addCard(Zone.BATTLEFIELD, playerA, galvanoth);
setChoice(playerA, true); // yes to look
setChoice(playerA, false); // no to cast
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertHandCount(playerA, 0);
}
@Test
public void test_Creature_NotCastable() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Goblin Piker");
addCard(Zone.BATTLEFIELD, playerA, galvanoth);
setChoice(playerA, true); // yes to look
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, galvanoth, 1);
}
}

View file

@ -0,0 +1,57 @@
package org.mage.test.cards.single.shm;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class MemoryPlunderTest extends CardTestPlayerBase {
/**
* {@link mage.cards.m.MemoryPlunder Memory Plunder} {U/B}{U/B}{U/B}{U/B}
* Instant
* You may cast target instant or sorcery card from an opponents graveyard without paying its mana cost.
*/
private static final String plunder = "Memory Plunder";
@Test
public void test_Divination_Cast() {
setStrictChooseMode(true);
addCard(Zone.GRAVEYARD, playerB, "Divination");
addCard(Zone.HAND, playerA, plunder);
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
castSpell(1, PhaseStep.UPKEEP, playerA, plunder, "Divination");
setChoice(playerA, true); // yes to cast
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, plunder, 1);
assertGraveyardCount(playerB, "Divination", 1); // back in graveyard
assertHandCount(playerA, 2);
}
@Test
public void test_Divination_No_Cast() {
setStrictChooseMode(true);
addCard(Zone.GRAVEYARD, playerB, "Divination");
addCard(Zone.HAND, playerA, plunder);
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
castSpell(1, PhaseStep.UPKEEP, playerA, plunder, "Divination");
setChoice(playerA, false);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, plunder, 1);
assertGraveyardCount(playerB, "Divination", 1); // not moved
assertHandCount(playerA, 0); // no cast so no draw
}
}