new m21 tests

This commit is contained in:
Ingmar Goudt 2020-07-25 23:49:58 +02:00
parent ffb649b414
commit 142681c354
9 changed files with 466 additions and 0 deletions

View file

@ -0,0 +1,115 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class AnimalSanctuaryTest extends CardTestPlayerBase {
private static final String sanctuary = "Animal Sanctuary";
private static final String bird = "Birds of Paradise";
private static final String cat = "Ajani's Pridemate";
private static final String dog = "Wild Mongrel";
private static final String goat = "Mountain Goat";
private static final String ox = "Raging Bull";
private static final String snake = "Anaconda";
@Test
public void boostBird(){
addCard(Zone.BATTLEFIELD, playerA, sanctuary);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, bird);
// {2}, {T}: Put a +1/+1 counter on target Bird, Cat, Dog, Goat, Ox, or Snake.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: ", bird);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, bird, CounterType.P1P1, 1);
}
@Test
public void boostCat(){
addCard(Zone.BATTLEFIELD, playerA, sanctuary);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, cat);
// {2}, {T}: Put a +1/+1 counter on target Bird, Cat, Dog, Goat, Ox, or Snake.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: ", cat);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, cat, CounterType.P1P1, 1);
}
@Test
public void boostDog(){
addCard(Zone.BATTLEFIELD, playerA, sanctuary);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, dog);
// {2}, {T}: Put a +1/+1 counter on target Bird, Cat, Dog, Goat, Ox, or Snake.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: ", dog);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, dog, CounterType.P1P1, 1);
}
@Test
public void boostGoat(){
addCard(Zone.BATTLEFIELD, playerA, sanctuary);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, goat);
// {2}, {T}: Put a +1/+1 counter on target Bird, Cat, Dog, Goat, Ox, or Snake.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: ", goat);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, goat, CounterType.P1P1, 1);
}
@Test
public void boostOx(){
addCard(Zone.BATTLEFIELD, playerA, sanctuary);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, ox);
// {2}, {T}: Put a +1/+1 counter on target Bird, Cat, Dog, Goat, Ox, or Snake.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: ", ox);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, ox, CounterType.P1P1, 1);
}
@Test
public void boostSnake(){
addCard(Zone.BATTLEFIELD, playerA, sanctuary);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, snake);
// {2}, {T}: Put a +1/+1 counter on target Bird, Cat, Dog, Goat, Ox, or Snake.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: ", snake);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, snake, CounterType.P1P1, 1);
}
}

View file

@ -0,0 +1,54 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class ArchfiendsVesselTest extends CardTestPlayerBase {
private static final String archfiendsVessel = "Archfiend's Vessel";
@Test
public void enterFromGraveyard(){
//When Archfiend's Vessel enters the battlefield, if it entered from your graveyard or you cast it from your graveyard,
// exile it. If you do, create a 5/5 black Demon creature token with flying.
addCard(Zone.GRAVEYARD, playerA, archfiendsVessel);
addCard(Zone.HAND, playerA, "Exhume");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exhume");
addTarget(playerA, archfiendsVessel);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Demon", 1);
assertExileCount(playerA, archfiendsVessel, 1);
}
@Test
public void playFromGraveyard(){
//When Archfiend's Vessel enters the battlefield, if it entered from your graveyard or you cast it from your graveyard,
// exile it. If you do, create a 5/5 black Demon creature token with flying.
addCard(Zone.GRAVEYARD, playerA, archfiendsVessel);
// Until end of turn, you may play cards from your graveyard.
addCard(Zone.HAND, playerA, "Yawgmoth's Will");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yawgmoth's Will");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, archfiendsVessel);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Demon", 1);
assertExileCount(playerA, archfiendsVessel, 1);
}
}

View file

@ -0,0 +1,25 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class AvenGagglemasterTest extends CardTestPlayerBase {
@Test
public void gainLife(){
addCard(Zone.HAND, playerA, "Aven Gagglemaster");
addCard(Zone.BATTLEFIELD, playerA, "Plains", 10);
addCard(Zone.BATTLEFIELD, playerB, "Birds of Paradise");
// When Aven Gagglemaster enters the battlefield, you gain 2 life for each creature you control with flying.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aven Gagglemaster");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertLife(playerA, 22);
}
}

View file

@ -0,0 +1,31 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class AzusaLostButSeekingTest extends CardTestPlayerBase {
private static final String azusa = "Azusa, Lost but Seeking";
@Test
@Ignore
public void playAdditionalLands(){
addCard(Zone.BATTLEFIELD, playerA, azusa);
addCard(Zone.HAND, playerA, "Forest", 4);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Forest", 3);
}
}

View file

@ -0,0 +1,30 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class BadDealTest extends CardTestPlayerBase {
@Test
public void castBadDeal(){
addCard(Zone.HAND, playerA, "Bad Deal");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 6);
addCard(Zone.HAND, playerB, "Forest", 2);
addCard(Zone.LIBRARY, playerA, "Swamp", 2);
// You draw two cards and each opponent discards two cards. Each player loses 2 life.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bad Deal");
addTarget(playerB, "Forest^Forest");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertLife(playerA, 18);
assertLife(playerB, 18);
assertHandCount(playerA, 2);
assertHandCount(playerB, 0);
}
}

View file

@ -0,0 +1,72 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class BarrinTolarianArchmageTest extends CardTestPlayerBase {
private static final String barrin = "Barrin, Tolarian Archmage";
@Test
public void returnOwnCreature(){
// When Barrin, Tolarian Archmage enters the battlefield, return up to one other target creature or planeswalker to its owner's hand.
addCard(Zone.HAND, playerA, barrin);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
addCard(Zone.LIBRARY, playerA, "Forest");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, barrin);
addTarget(playerA, "Grizzly Bears");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
// At the beginning of your end step, if a permanent was put into your hand from the battlefield this turn, draw a card.
assertHandCount(playerA, 2);
}
@Test
public void returnOwnPlanesWalker(){
// When Barrin, Tolarian Archmage enters the battlefield, return up to one other target creature or planeswalker to its owner's hand.
addCard(Zone.HAND, playerA, barrin);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Basri Ket");
addCard(Zone.LIBRARY, playerA, "Forest");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, barrin);
addTarget(playerA, "Basri Ket");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
// At the beginning of your end step, if a permanent was put into your hand from the battlefield this turn, draw a card.
assertHandCount(playerA, 2);
}
@Test
public void returnOpponentsPlanesWalker(){
// When Barrin, Tolarian Archmage enters the battlefield, return up to one other target creature or planeswalker to its owner's hand.
addCard(Zone.HAND, playerA, barrin);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerB, "Basri Ket");
addCard(Zone.LIBRARY, playerA, "Forest");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, barrin);
addTarget(playerA, "Basri Ket");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
// At the beginning of your end step, if a permanent was put into your hand from the battlefield this turn, draw a card.
assertHandCount(playerA, 0);
}
}

View file

@ -0,0 +1,76 @@
package org.mage.test.cards.single.m21;
import mage.abilities.keyword.IndestructibleAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class BasriKetTest extends CardTestPlayerBase {
private static final String basriKet = "Basri Ket";
@Test
public void addCounterOnCreature(){
addCard(Zone.BATTLEFIELD, playerA, basriKet);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
// +1: Put a +1/+1 counter on up to one target creature. It gains indestructible until end of turn.
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: ");
addTarget(playerA, "Grizzly Bears");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, "Grizzly Bears", CounterType.P1P1, 1);
assertAbility(playerA, "Grizzly Bears", IndestructibleAbility.getInstance(), true);
}
@Test
public void attack(){
addCard(Zone.BATTLEFIELD, playerA, basriKet);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
// 2: Whenever one or more nontoken creatures attack this turn, create that many 1/1 white Soldier creature tokens that are tapped and attacking.
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "-2: ");
attack(3, playerA, "Grizzly Bears");
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertLife(playerB, 17);
assertPermanentCount(playerA, "Soldier", 1);
}
@Test
public void emblem(){
addCard(Zone.BATTLEFIELD, playerA, basriKet);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
// turn 1: loyalty 4
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: ");
addTarget(playerA, "Grizzly Bears");
// turn 3: loyalty 5
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: ");
addTarget(playerA, "Grizzly Bears");
// turn 5: loyalty 6
activateAbility(5, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: ");
addTarget(playerA, "Grizzly Bears");
// 6: You get an emblem with "At the beginning of combat on your turn, create a 1/1 white Soldier creature token, then put a +1/+1 counter on each creature you control."
activateAbility(7, PhaseStep.PRECOMBAT_MAIN, playerA, "-6: ");
attack(7, playerA, "Grizzly Bears");
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertLife(playerB, 14);
assertPermanentCount(playerA, "Soldier", 1);
}
}

View file

@ -0,0 +1,30 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class BasrisAcolyteTest extends CardTestPlayerBase {
private static final String basrisAcolyte = "Basri's Acolyte";
@Test
public void checkETB(){
addCard(Zone.HAND, playerA, basrisAcolyte);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
addCard(Zone.BATTLEFIELD, playerA, "Savannah Lions");
// When Basri's Acolyte enters the battlefield, put a +1/+1 counter on each of up to two other target creatures you control.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, basrisAcolyte);
addTarget(playerA, "Grizzly Bears^Savannah Lions");
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertCounterCount(playerA, "Grizzly Bears", CounterType.P1P1, 1);
assertCounterCount(playerA, "Savannah Lions", CounterType.P1P1, 1);
}
}

View file

@ -0,0 +1,33 @@
package org.mage.test.cards.single.m21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class BasrisAegisTest extends CardTestPlayerBase {
@Test
public void castBasrisAegis(){
addCard(Zone.HAND, playerA, "Basri's Aegis");
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
addCard(Zone.BATTLEFIELD, playerA, "Savannah Lions");
addCard(Zone.LIBRARY, playerA, "Basri, Devoted Paladin");
// Put a +1/+1 counter on each of up to two target creatures.
// You may search your library and/or graveyard for a card named Basri, Devoted Paladin, reveal it, and put it into your hand. If you search your library this way, shuffle it.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Basri's Aegis");
addTarget(playerA, "Grizzly Bears^Savannah Lions");
setChoice(playerA, "Yes");
addTarget(playerA, "Basri, Devoted Paladin");
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertHandCount(playerA, 1);
assertCounterCount(playerA, "Grizzly Bears", CounterType.P1P1, 1);
assertCounterCount(playerA, "Savannah Lions", CounterType.P1P1, 1);
}
}