mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
add tests to increase coverage
This commit is contained in:
parent
4410374840
commit
c16b3d6056
12 changed files with 710 additions and 0 deletions
|
|
@ -0,0 +1,55 @@
|
|||
package org.mage.test.cards.continuous;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class AddCardSubtypeAllEffectTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Kudo, King Among Bears
|
||||
{G}{W}
|
||||
Legendary Creature — Bear
|
||||
Other creatures have base power and toughness 2/2 and are Bears in addition to their other types.
|
||||
2/2
|
||||
*/
|
||||
private static final String kudo = "Kudo, King Among Bears";
|
||||
|
||||
/*
|
||||
Fugitive Wizard
|
||||
{U}
|
||||
Creature — Human Wizard
|
||||
1/1
|
||||
*/
|
||||
private static final String fugitive = "Fugitive Wizard";
|
||||
|
||||
@Test
|
||||
public void testAddCardSubtypeAllEffect() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, fugitive, 3);
|
||||
addCard(Zone.BATTLEFIELD, playerB, fugitive, 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, kudo);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Savannah", 2);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) {
|
||||
if (permanent.getName().equals(fugitive)) {
|
||||
assertTrue(permanent.hasSubtype(SubType.BEAR, currentGame));
|
||||
assertTrue(permanent.hasSubtype(SubType.WIZARD, currentGame));
|
||||
assertTrue(permanent.hasSubtype(SubType.HUMAN, currentGame));
|
||||
assertEquals(2, permanent.getPower().getModifiedBaseValue());
|
||||
assertEquals(2, permanent.getToughness().getModifiedBaseValue());
|
||||
}
|
||||
}
|
||||
|
||||
assertSubtype(kudo, SubType.BEAR);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package org.mage.test.cards.continuous;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class BecomesColorEffectTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Ancient Kavu
|
||||
{3}{R}
|
||||
Creature — Kavu
|
||||
{2}: This creature becomes colorless until end of turn.
|
||||
Those with the ability to change their nature survived Phyrexia’s biological attacks. Everything else died.
|
||||
3/3
|
||||
*/
|
||||
String kavu = "Ancient Kavu";
|
||||
/*
|
||||
Alchor's Tomb
|
||||
{4}
|
||||
Artifact
|
||||
{2}, {T}: Target permanent you control becomes the color of your choice. (This effect lasts indefinitely.)
|
||||
*/
|
||||
String alchorsTomb = "Alchor's Tomb";
|
||||
/*
|
||||
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void testBecomesColorSource() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, kavu);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
|
||||
|
||||
checkColor("Ancient Kavu is red", 1, PhaseStep.PRECOMBAT_MAIN, playerA, kavu, "R", true);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}: {this}");
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
checkColor("Ancient Kavu is colorless", 1, PhaseStep.PRECOMBAT_MAIN, playerA, kavu, "C", true);
|
||||
checkColor("Ancient Kavu is red again", 2, PhaseStep.PRECOMBAT_MAIN, playerA, kavu, "R", true);
|
||||
|
||||
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBecomesColorTarget() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, kavu);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, alchorsTomb);
|
||||
|
||||
checkColor("Ancient Kavu is red", 1, PhaseStep.PRECOMBAT_MAIN, playerA, kavu, "R", true);
|
||||
// make Ancient Kavu green
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: Target permanent", kavu);
|
||||
setChoice(playerA, "Green");
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
checkColor("Ancient Kavu is green", 1, PhaseStep.PRECOMBAT_MAIN, playerA, kavu, "G", true);
|
||||
checkColor("Ancient Kavu is still green the following turn", 2, PhaseStep.PRECOMBAT_MAIN, playerA, kavu, "G", true);
|
||||
// activate Ancient Kavu's ability to override green color until end of turn
|
||||
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}: {this}");
|
||||
checkColor("Ancient Kavu is colorless", 3, PhaseStep.POSTCOMBAT_MAIN, playerA, kavu, "C", true);
|
||||
// next turn it should be green again
|
||||
checkColor("Ancient Kavu is green again", 4, PhaseStep.PRECOMBAT_MAIN, playerA, kavu, "G", true);
|
||||
|
||||
setStopAt(4, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package org.mage.test.cards.continuous;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.filter.predicate.mageobject.ToughnessPredicate;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class BecomesCreatureEffectTest extends CardTestPlayerBase {
|
||||
/*
|
||||
Ambush Commander
|
||||
{3}{G}{G}
|
||||
Creature — Elf
|
||||
Forests you control are 1/1 green Elf creatures that are still lands.
|
||||
{1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.
|
||||
2/2
|
||||
*/
|
||||
String ambushCommander = "Ambush Commander";
|
||||
/*
|
||||
Dryad Arbor
|
||||
Land Creature — Forest Dryad
|
||||
1/1
|
||||
*/
|
||||
String dryadArbor = "Dryad Arbor";
|
||||
/*
|
||||
Frogify
|
||||
{1}{U}
|
||||
Enchantment — Aura
|
||||
Enchant creature
|
||||
Enchanted creature loses all abilities and is a blue Frog creature with base power and toughness 1/1.
|
||||
(It loses all other card types and creature types.)
|
||||
*/
|
||||
String frogify = "Frogify";
|
||||
@Test
|
||||
public void testBecomesCreatureAllEffect() {
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(CardType.CREATURE.getPredicate());
|
||||
filter.add(SubType.ELF.getPredicate());
|
||||
filter.add(new PowerPredicate(ComparisonType.EQUAL_TO, 1));
|
||||
filter.add(new ToughnessPredicate(ComparisonType.EQUAL_TO, 1));
|
||||
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
|
||||
addCard(Zone.BATTLEFIELD, playerA, dryadArbor);
|
||||
addCard(Zone.HAND, playerA, ambushCommander);
|
||||
|
||||
runCode("Check forests are not 1/1 Elves", 1, PhaseStep.PRECOMBAT_MAIN, playerA, (info, player, game) -> {
|
||||
int numElves = game.getBattlefield().getActivePermanents(filter, player.getId(), game).size();
|
||||
Assert.assertEquals("No 1/1 elves should be present", 0, numElves);
|
||||
});
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ambushCommander);
|
||||
runCode("Check forests are 1/1 Elves", 1, PhaseStep.BEGIN_COMBAT, playerA, (info, player, game) -> {
|
||||
int numElves = game.getBattlefield().getActivePermanents(filter, player.getId(), game).size();
|
||||
// 5 forests + dryad arbor
|
||||
Assert.assertEquals("There should be 6 1/1 elves present", 6, numElves);
|
||||
});
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBecomesCreatureAttachedEffect() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, dryadArbor);
|
||||
addCard(Zone.HAND, playerA, frogify);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, frogify, dryadArbor);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAbilities(playerA, dryadArbor, Collections.emptyList());
|
||||
assertPowerToughness(playerA, dryadArbor, 1, 1);
|
||||
assertType(dryadArbor, CardType.CREATURE, SubType.FROG);
|
||||
assertNotSubtype(dryadArbor, SubType.DRYAD);
|
||||
assertNotType(dryadArbor, CardType.LAND);
|
||||
assertColor(playerA, dryadArbor, ObjectColor.BLUE, true);
|
||||
assertColor(playerA, dryadArbor, ObjectColor.GREEN, false);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package org.mage.test.cards.continuous;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class BecomesCreatureIfVehicleEffectTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Aerial Modification
|
||||
{4}{W}
|
||||
Enchantment — Aura
|
||||
Enchant creature or Vehicle
|
||||
As long as enchanted permanent is a Vehicle, it’s a creature in addition to its other types.
|
||||
Enchanted creature gets +2/+2 and has flying.
|
||||
*/
|
||||
String aerialMod = "Aerial Modification";
|
||||
/*
|
||||
Goliath Truck
|
||||
{4}
|
||||
Artifact — Vehicle
|
||||
Stowage — Whenever this Vehicle attacks, put two +1/+1 counters on another target attacking creature.
|
||||
Crew 2 (Tap any number of creatures you control with total power 2 or more: This Vehicle becomes an artifact creature until end of turn.)
|
||||
4/4
|
||||
*/
|
||||
String goliathTruck = "Goliath Truck";
|
||||
|
||||
@Test
|
||||
public void testBecomesCreatureIfVehicleEffect() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, goliathTruck);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
|
||||
addCard(Zone.HAND, playerA, aerialMod);
|
||||
|
||||
checkType("Goliath Truck is not a creature", 1, PhaseStep.PRECOMBAT_MAIN, playerA, goliathTruck, CardType.CREATURE, false);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, aerialMod, goliathTruck);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertType(goliathTruck, CardType.CREATURE, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package org.mage.test.cards.single._5ed;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class AnHavvaConstableTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
An-Havva Constable
|
||||
{1}{G}{G}
|
||||
Creature — Human
|
||||
An-Havva Constable’s toughness is equal to 1 plus the number of green creatures on the battlefield.
|
||||
2/1+*
|
||||
*/
|
||||
private static final String constable = "An-Havva Constable";
|
||||
/*
|
||||
Bear Cub
|
||||
{1}{G}
|
||||
Creature — Bear
|
||||
2/2
|
||||
*/
|
||||
private static final String cub = "Bear Cub";
|
||||
@Test
|
||||
public void testAnHavva() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
addCard(Zone.BATTLEFIELD, playerA, constable);
|
||||
addCard(Zone.HAND, playerA, constable);
|
||||
addCard(Zone.BATTLEFIELD, playerA, cub, 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, cub, 3);
|
||||
addCard(Zone.HAND, playerA, "Lightning Bolt");
|
||||
|
||||
checkPT("An-Havva Constable has toughness 7", 1, PhaseStep.PRECOMBAT_MAIN, playerA, constable, 2, 1 + 6);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", cub);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
checkPT("An-Havva Constable has toughness 6", 1, PhaseStep.PRECOMBAT_MAIN, playerA, constable, 2, 1 + 5);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
playerA.getHand().getCards(currentGame).stream()
|
||||
.filter(card -> card.getName().equals(constable))
|
||||
.findFirst().
|
||||
ifPresent(card -> Assert.assertEquals(6, card.getToughness().getValue()));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package org.mage.test.cards.single.c13;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class ActOfAuthorityEffectTest extends CardTestPlayerBase {
|
||||
/*
|
||||
Act of Authority
|
||||
{1}{W}{W}
|
||||
Enchantment
|
||||
When this enchantment enters, you may exile target artifact or enchantment.
|
||||
At the beginning of your upkeep, you may exile target artifact or enchantment. If you do, its controller gains control of this enchantment.
|
||||
*/
|
||||
private static final String actOfAuthority = "Act of Authority";
|
||||
|
||||
@Test
|
||||
public void testActOfAuthority() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, actOfAuthority);
|
||||
addCard(Zone.BATTLEFIELD, playerB, actOfAuthority + "@actB");
|
||||
|
||||
setChoice(playerA, true); // upkeep
|
||||
addTarget(playerA, "@actB");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerB, actOfAuthority, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package org.mage.test.cards.single.dft;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class AatchikEmeraldRadianTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Aatchik, Emerald Radian
|
||||
{3}{B}{B}{G}
|
||||
Legendary Creature — Insect Druid
|
||||
When Aatchik enters, create a 1/1 green Insect creature token for each artifact and/or creature card in your graveyard.
|
||||
Whenever another Insect you control dies, put a +1/+1 counter on Aatchik. Each opponent loses 1 life.
|
||||
3/3
|
||||
*/
|
||||
private static final String aatchik = "Aatchik, Emerald Radian";
|
||||
|
||||
/*
|
||||
Springheart Nantuko
|
||||
{1}{G}
|
||||
Enchantment Creature — Insect Monk
|
||||
Bestow {1}{G}
|
||||
Enchanted creature gets +1/+1.
|
||||
Landfall — Whenever a land you control enters, you may pay {1}{G} if this permanent is attached to a creature you control.
|
||||
If you do, create a token that’s a copy of that creature. If you didn’t create a token this way, create a 1/1 green Insect creature token.
|
||||
1/1
|
||||
*/
|
||||
private static final String nantuko = "Springheart Nantuko";
|
||||
|
||||
@Test
|
||||
public void testOpponentCreatingTokens() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, aatchik);
|
||||
addCard(Zone.BATTLEFIELD, playerB, aatchik);
|
||||
addCard(Zone.GRAVEYARD, playerA, aatchik);
|
||||
addCard(Zone.GRAVEYARD, playerB, aatchik);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 9);
|
||||
addCard(Zone.HAND, playerA, nantuko);
|
||||
addCard(Zone.HAND, playerA, "Bayou");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, nantuko + " using bestow");
|
||||
addTarget(playerA, aatchik);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bayou");
|
||||
setChoice(playerA, true);
|
||||
setChoice(playerA, aatchik);
|
||||
setChoice(playerA, "When {this} enters");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertTokenCount(playerB, "Insect Token", 0);
|
||||
assertTokenCount(playerA, "Insect Token", 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package org.mage.test.cards.single.fin;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class AettirAndPriwenTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Aettir and Priwen
|
||||
{6}
|
||||
Legendary Artifact — Equipment
|
||||
Equipped creature has base power and toughness X/X, where X is your life total.
|
||||
Equip {5}
|
||||
*/
|
||||
private static final String aettir = "Aettir and Priwen";
|
||||
/*
|
||||
Bear Cub
|
||||
{1}{G}
|
||||
Creature — Bear
|
||||
2/2
|
||||
*/
|
||||
private static final String cub = "Bear Cub";
|
||||
/*
|
||||
Lightning Bolt
|
||||
{R}
|
||||
Instant
|
||||
Lightning Bolt deals 3 damage to any target.
|
||||
*/
|
||||
public static final String bolt = "Lightning Bolt";
|
||||
|
||||
@Test
|
||||
public void testAettirAndPriwen() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, aettir);
|
||||
addCard(Zone.BATTLEFIELD, playerA, cub);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7);
|
||||
addCard(Zone.HAND, playerA, bolt, 2);
|
||||
|
||||
checkPowerToughness(2, cub, 1, PhaseStep.PRECOMBAT_MAIN);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{5}: Equip");
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
checkPowerToughness(20, cub, 1, PhaseStep.PRECOMBAT_MAIN);
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, bolt, playerA);
|
||||
waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
checkPowerToughness(20 - 3, cub, 1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, bolt, playerA);
|
||||
waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
checkPowerToughness(20 - 3 * 2, cub, 1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
|
||||
checkPowerToughness(20 - 3 * 2, cub, 2, PhaseStep.PRECOMBAT_MAIN);
|
||||
}
|
||||
|
||||
void checkPowerToughness(int xValue, String name, int turnNum, PhaseStep phaseStep) {
|
||||
runCode("Checking P/T is " + xValue, turnNum, phaseStep, playerA, (info, player, game) -> {
|
||||
Permanent permanent = getPermanent(name, player);
|
||||
Assert.assertEquals(xValue, permanent.getPower().getModifiedBaseValue());
|
||||
Assert.assertEquals(xValue, permanent.getToughness().getModifiedBaseValue());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package org.mage.test.cards.single.lci;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class AbuelosAwakeningTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Abuelo's Awakening
|
||||
{X}{3}{W}
|
||||
Sorcery
|
||||
Return target artifact or non-Aura enchantment card from your graveyard to the battlefield with X additional +1/+1 counters on it.
|
||||
It’s a 1/1 Spirit creature with flying in addition to its other types.
|
||||
*/
|
||||
public static final String abuelosAwakening = "Abuelo's Awakening";
|
||||
/*
|
||||
Talisman of Progress
|
||||
{2}
|
||||
Artifact
|
||||
{T}: Add {C}.
|
||||
{T}: Add {W} or {U}. This artifact deals 1 damage to you.
|
||||
*/
|
||||
public static final String talisman = "Talisman of Progress";
|
||||
/*
|
||||
Lightning Bolt
|
||||
{R}
|
||||
Instant
|
||||
Lightning Bolt deals 3 damage to any target.
|
||||
*/
|
||||
public static final String bolt = "Lightning Bolt";
|
||||
|
||||
@Test
|
||||
public void testAbuelosAwakening() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.GRAVEYARD, playerA, talisman);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
|
||||
addCard(Zone.HAND, playerA, abuelosAwakening);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, abuelosAwakening, talisman);
|
||||
setChoiceAmount(playerA, 2);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertCounterCount(playerA, talisman, CounterType.P1P1, 2);
|
||||
assertType(talisman, CardType.CREATURE, true);
|
||||
assertSubtype(talisman, SubType.SPIRIT);
|
||||
assertBasePowerToughness(playerA, talisman, 1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAbuelosAwakeningDies() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.GRAVEYARD, playerA, talisman);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
|
||||
addCard(Zone.HAND, playerA, abuelosAwakening);
|
||||
addCard(Zone.HAND, playerB, bolt);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, abuelosAwakening, talisman);
|
||||
setChoiceAmount(playerA, 2);
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, bolt, talisman);
|
||||
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, talisman, 0);
|
||||
assertGraveyardCount(playerA, talisman, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package org.mage.test.cards.single.m19;
|
||||
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class AlpineMoonTest extends CardTestPlayerBase {
|
||||
/*
|
||||
Alpine Moon
|
||||
{R}
|
||||
Enchantment
|
||||
As this enchantment enters, choose a nonbasic land card name.
|
||||
Lands your opponents control with the chosen name lose all land types and abilities, and they gain “{T}: Add one mana of any color.”
|
||||
*/
|
||||
private static final String alpine = "Alpine Moon";
|
||||
/*
|
||||
Urborg, Tomb of Yawgmoth
|
||||
Legendary Land
|
||||
Each land is a Swamp in addition to its other land types.
|
||||
*/
|
||||
private static final String urborg = "Urborg, Tomb of Yawgmoth";
|
||||
|
||||
@Test
|
||||
public void testAlpineMoonAfterUrborg() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, urborg);
|
||||
addCard(Zone.BATTLEFIELD, playerB, alpine);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island");
|
||||
|
||||
setChoice(playerB, urborg);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertNotSubtype(urborg, SubType.SWAMP);
|
||||
assertSubtype("Mountain", SubType.SWAMP);
|
||||
assertSubtype("Island", SubType.SWAMP);
|
||||
assertAbility(playerA, urborg, new AnyColorManaAbility(), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAlpineMoonBeforeUrborg() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerB, urborg);
|
||||
addCard(Zone.BATTLEFIELD, playerA, alpine);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island");
|
||||
|
||||
setChoice(playerA, urborg);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertNotSubtype(urborg, SubType.SWAMP);
|
||||
assertSubtype("Mountain", SubType.SWAMP);
|
||||
assertSubtype("Island", SubType.SWAMP);
|
||||
assertAbility(playerB, urborg, new AnyColorManaAbility(), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package org.mage.test.cards.single.mh2;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class AeveProgenitorOozeTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Aeve, Progenitor Ooze
|
||||
{2}{G}{G}{G}
|
||||
Legendary Creature — Ooze
|
||||
Storm (When you cast this spell, copy it for each spell cast before it this turn. Copies become tokens.)
|
||||
Aeve isn’t legendary if it’s a token.
|
||||
Aeve enters with a +1/+1 counter on it for each other Ooze you control.
|
||||
2/2
|
||||
*/
|
||||
private static final String aeve = "Aeve, Progenitor Ooze";
|
||||
/*
|
||||
Lightning Bolt
|
||||
{R}
|
||||
Instant
|
||||
Lightning Bolt deals 3 damage to any target.
|
||||
*/
|
||||
public static final String bolt = "Lightning Bolt";
|
||||
|
||||
@Test
|
||||
public void testAeve() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.HAND, playerA, aeve);
|
||||
addCard(Zone.HAND, playerA, bolt);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bolt, playerB);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, aeve);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, aeve, 2);
|
||||
assertTokenCount(playerA, aeve, 1);
|
||||
for (Permanent permanent : currentGame.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerA.getId(), currentGame)) {
|
||||
if (permanent.getName().equals(aeve)) {
|
||||
if (permanent instanceof PermanentToken) {
|
||||
Assert.assertEquals(0, permanent.getCounters(currentGame).getCount(CounterType.P1P1));
|
||||
} else {
|
||||
Assert.assertEquals(1, permanent.getCounters(currentGame).getCount(CounterType.P1P1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package org.mage.test.cards.single.tmp;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class AlurenTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Aluren
|
||||
{2}{G}{G}
|
||||
Enchantment
|
||||
Any player may cast creature spells with mana value 3 or less without paying their mana costs and as though they had flash.
|
||||
*/
|
||||
private static final String aluren = "Aluren";
|
||||
|
||||
/*
|
||||
Bear Cub
|
||||
{1}{G}
|
||||
Creature — Bear
|
||||
2/2
|
||||
*/
|
||||
private static final String cub = "Bear Cub";
|
||||
|
||||
@Test
|
||||
public void testAluren() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, aluren);
|
||||
addCard(Zone.HAND, playerA, cub);
|
||||
addCard(Zone.HAND, playerB, cub);
|
||||
|
||||
castSpell(1, PhaseStep.UPKEEP, playerA, cub);
|
||||
setChoice(playerA, "Cast without paying its mana cost");
|
||||
|
||||
castSpell(1, PhaseStep.END_TURN, playerB, cub);
|
||||
setChoice(playerB, "Cast without paying its mana cost");
|
||||
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, cub, 1);
|
||||
assertPermanentCount(playerB, cub, 1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue