mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
add comments, strictmode and assertAllCommandsUsed to m21 tests
This commit is contained in:
parent
202e25208e
commit
40f73375da
5 changed files with 98 additions and 14 deletions
|
@ -8,40 +8,51 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
|
||||
public class AdherentOfHopeTest extends CardTestPlayerBase {
|
||||
|
||||
// At the beginning of combat on your turn, if you control a Basri planeswalker, put a +1/+1 counter on Adherent of Hope.
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void test_basri_in_play_controllerturn(){
|
||||
// At the beginning of combat on your turn, if you control a Basri planeswalker, put a +1/+1 counter on Adherent of Hope.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Adherent of Hope", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Basri Ket", 1);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertCounterCount(playerA, "Adherent of Hope", CounterType.P1P1, 1);
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertCounterCount(playerA, "Adherent of Hope", CounterType.P1P1, 1);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_basri_in_play_opponentturn(){
|
||||
// At the beginning of combat on your turn, if you control a Basri planeswalker, put a +1/+1 counter on Adherent of Hope.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Adherent of Hope", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Basri Ket", 1);
|
||||
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertCounterCount(playerA, "Adherent of Hope", CounterType.P1P1, 1);
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertCounterCount(playerA, "Adherent of Hope", CounterType.P1P1, 1);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_no_basri_in_play_controllerturn(){
|
||||
// At the beginning of combat on your turn, if you control a Basri planeswalker, put a +1/+1 counter on Adherent of Hope.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Adherent of Hope", 1);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertCounterCount(playerA, "Adherent of Hope", CounterType.P1P1, 0);
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertCounterCount(playerA, "Adherent of Hope", CounterType.P1P1, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,21 +12,25 @@ public class AlchemistsGiftTest extends CardTestPlayerBase {
|
|||
private final String deathtouch = "Yes";
|
||||
private final String lifelink = "No";
|
||||
|
||||
// Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn.
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void giveDeathTouch(){
|
||||
setStrictChooseMode(true);
|
||||
// Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Alchemist's Gift");
|
||||
addCard(Zone.BATTLEFIELD,playerA, "Adherent of Hope", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp");
|
||||
addCard(Zone.HAND, playerA, "Alchemist's Gift");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alchemist's Gift", "Adherent of Hope");
|
||||
// give Deathtouch
|
||||
setChoice(playerA, deathtouch);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertAbility(playerA, "Adherent of Hope", DeathtouchAbility.getInstance(), true);
|
||||
assertAbility(playerA, "Adherent of Hope", LifelinkAbility.getInstance(), false);
|
||||
assertPowerToughness(playerA, "Adherent of Hope", 3, 2);
|
||||
|
@ -34,13 +38,16 @@ public class AlchemistsGiftTest extends CardTestPlayerBase {
|
|||
|
||||
@Test
|
||||
public void giveLifelink(){
|
||||
setStrictChooseMode(true);
|
||||
// Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Alchemist's Gift");
|
||||
addCard(Zone.BATTLEFIELD,playerA, "Adherent of Hope", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp");
|
||||
addCard(Zone.HAND, playerA, "Alchemist's Gift");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alchemist's Gift", "Adherent of Hope");
|
||||
// give Lifelink
|
||||
setChoice(playerA, lifelink);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
|
|
@ -7,11 +7,12 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
|
||||
public class AlpineHoundmasterTest extends CardTestPlayerBase {
|
||||
|
||||
// When Alpine Houndmaster enters the battlefield, you may search your library for a card named Alpine Watchdog and/or a card named Igneous Cur, reveal them, put them into your hand, then shuffle your library.
|
||||
|
||||
|
||||
@Test
|
||||
public void searchDog() {
|
||||
// When Alpine Houndmaster enters the battlefield, you may search your library for a card named
|
||||
// Alpine Watchdog and/or a card named Igneous Cur, reveal them, put them into your hand, then shuffle your library.
|
||||
addCard(Zone.HAND, playerA, "Alpine Houndmaster", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains");
|
||||
|
@ -20,14 +21,64 @@ public class AlpineHoundmasterTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alpine Houndmaster");
|
||||
setChoice(playerA, "Yes");
|
||||
addTarget(playerA, "Alpine Watchdog");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertHandCount(playerA, 1);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void searchCur() {
|
||||
// When Alpine Houndmaster enters the battlefield, you may search your library for a card named
|
||||
// Alpine Watchdog and/or a card named Igneous Cur, reveal them, put them into your hand, then shuffle your library.
|
||||
addCard(Zone.HAND, playerA, "Alpine Houndmaster", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains");
|
||||
addCard(Zone.LIBRARY, playerA, "Alpine Watchdog");
|
||||
addCard(Zone.LIBRARY, playerA, "Igneous Cur");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alpine Houndmaster");
|
||||
setChoice(playerA, "Yes");
|
||||
addTarget(playerA, "Igneous Cur");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertHandCount(playerA, 1);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void searchBoth() {
|
||||
// When Alpine Houndmaster enters the battlefield, you may search your library for a card named
|
||||
// Alpine Watchdog and/or a card named Igneous Cur, reveal them, put them into your hand, then shuffle your library.
|
||||
addCard(Zone.HAND, playerA, "Alpine Houndmaster", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains");
|
||||
addCard(Zone.LIBRARY, playerA, "Alpine Watchdog");
|
||||
addCard(Zone.LIBRARY, playerA, "Igneous Cur");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alpine Houndmaster");
|
||||
setChoice(playerA, "Yes");
|
||||
addTarget(playerA, "Igneous Cur^Alpine Watchdog");
|
||||
//addTarget(playerA, "");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertHandCount(playerA, 2);
|
||||
|
||||
}
|
||||
|
||||
// Whenever Alpine Houndmaster attacks, it gets +X/+0 until end of turn, where X is the number of other attacking creatures.
|
||||
|
||||
|
||||
@Test
|
||||
|
@ -36,11 +87,15 @@ public class AlpineHoundmasterTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerA, "Alpine Watchdog");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Igneous Cur");
|
||||
|
||||
// Whenever Alpine Houndmaster attacks, it gets +X/+0 until end of turn, where X is the number of other attacking creatures.
|
||||
attack(3, playerA, "Alpine Houndmaster");
|
||||
attack(3, playerA, "Alpine Watchdog");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, "Alpine Houndmaster", 3, 2);
|
||||
|
||||
}
|
||||
|
|
|
@ -8,19 +8,22 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
public class AngelicAscensionTest extends CardTestPlayerBase {
|
||||
|
||||
|
||||
// Exile target creature or planeswalker. Its controller creates a 4/4 white Angel creature token with flying.
|
||||
|
||||
|
||||
@Test
|
||||
public void exileCreatureOpponent(){
|
||||
// Exile target creature or planeswalker. Its controller creates a 4/4 white Angel creature token with flying.
|
||||
addCard(Zone.HAND, playerA, "Angelic Ascension");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Grizzly Bears");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angelic Ascension", "Grizzly Bears");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
setStrictChooseMode(true);
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertExileCount(playerB, 1);
|
||||
assertPermanentCount(playerB, "Angel", 1);
|
||||
assertPowerToughness(playerB, "Angel", 4, 4);
|
||||
|
@ -33,9 +36,12 @@ public class AngelicAscensionTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angelic Ascension", "Grizzly Bears");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertExileCount(playerA, 1);
|
||||
assertPermanentCount(playerA, "Angel", 1);
|
||||
assertPowerToughness(playerA, "Angel", 4, 4);
|
||||
|
|
|
@ -7,20 +7,25 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
|
||||
public class AnointedChoristerTest extends CardTestPlayerBase {
|
||||
|
||||
// {4}{W}: Anointed Chorister gets +3/+3 until end of turn.
|
||||
|
||||
private final String chorister = "Anointed Chorister";
|
||||
|
||||
|
||||
@Test
|
||||
public void buff(){
|
||||
// 1/1 Lifelink
|
||||
addCard(Zone.BATTLEFIELD, playerA, chorister);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 10);
|
||||
|
||||
// {4}{W}: Anointed Chorister gets +3/+3 until end of turn.
|
||||
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{4}{W}:");
|
||||
attack(3, playerA, chorister);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(4, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 24);
|
||||
assertLife(playerB, 16);
|
||||
assertPowerToughness(playerA, chorister, 1, 1);
|
||||
|
|
Loading…
Reference in a new issue