Added some tests.

This commit is contained in:
LevelX2 2015-06-16 14:41:28 +02:00
parent 0b46aec09c
commit d8df53dde7
3 changed files with 96 additions and 5 deletions

View file

@ -73,5 +73,46 @@ public class ReturnToHandTest extends CardTestPlayerBase {
}
/**
* Return from graveyard to hand if you play a swamp
*/
@Test
public void VeilbornGhoulTest1() {
// Veilborn Ghoul can't block.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
addCard(Zone.HAND, playerA, "Swamp");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swamp");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Swamp", 1);
assertHandCount(playerA, "Veilborn Ghoul", 1);
}
/**
* Return from graveyard to hand if you play a non swamp land but Urborg, Tomb of Yawgmoth is in play
*/
@Test
public void VeilbornGhoulTest2() {
// Veilborn Ghoul can't block.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
addCard(Zone.HAND, playerA, "Flood Plain");
// Each land is a Swamp in addition to its other land types.
addCard(Zone.BATTLEFIELD, playerA, "Urborg, Tomb of Yawgmoth", 1);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flood Plain");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Flood Plain", 1);
assertHandCount(playerA, "Veilborn Ghoul", 1);
}
}
}

View file

@ -146,5 +146,58 @@ public class LandfallTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Silvercoat Lion" , 1);
}
@Test
public void testGroundswellWithoutLandfall() {
// Target creature gets +2/+2 until end of turn.
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
addCard(Zone.HAND, playerB, "Groundswell",1);
addCard(Zone.BATTLEFIELD, playerB, "Forest",1);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
attack(2, playerB, "Silvercoat Lion");
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertPermanentCount(playerB, "Forest", 1);
assertGraveyardCount(playerB, "Groundswell" , 1);
assertPermanentCount(playerB, "Silvercoat Lion" , 1);
assertPowerToughness(playerB, "Silvercoat Lion", 4, 4);
assertLife(playerA, 16); // 2 + 4
assertLife(playerB, 20);
}
@Test
public void testGroundswellWithLandfall() {
// Target creature gets +2/+2 until end of turn.
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
addCard(Zone.HAND, playerB, "Groundswell",1);
addCard(Zone.HAND, playerB, "Forest");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest");
attack(2, playerB, "Silvercoat Lion");
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertPermanentCount(playerB, "Forest", 1);
assertGraveyardCount(playerB, "Groundswell" , 1);
assertPermanentCount(playerB, "Silvercoat Lion" , 1);
assertPowerToughness(playerB, "Silvercoat Lion", 6, 6);
assertLife(playerA, 14); // 2 + 4
assertLife(playerB, 20);
}
}

View file

@ -29,10 +29,7 @@
package mage.filter.common;
import mage.constants.AsThoughEffectType;
import mage.filter.predicate.ObjectPlayer;
import mage.filter.predicate.ObjectPlayerPredicate;
import mage.filter.predicate.Predicate;
import mage.game.Controllable;
import mage.game.Game;
import mage.game.permanent.Permanent;