mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Added tests for previously untested effects/values
This commit is contained in:
parent
beec1f30c5
commit
10ac777a28
2 changed files with 109 additions and 0 deletions
|
@ -0,0 +1,28 @@
|
|||
package org.mage.test.cards.single.ema;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class DeathriteShamanTest extends CardTestPlayerBase {
|
||||
// {T}: Exile target land card from a graveyard. Add one mana of any color.
|
||||
// {B}, {T}: Exile target instant or sorcery card from a graveyard. Each opponent loses 2 life.
|
||||
// {G}, {T}: Exile target creature card from a graveyard. You gain 2 life.
|
||||
private static final String deathriteShaman = "Deathrite Shaman";
|
||||
|
||||
/**
|
||||
* Check that the first ability uses the stack (and that the dynamic value works)
|
||||
*/
|
||||
@Test
|
||||
public void manaAbility() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, deathriteShaman);
|
||||
addCard(Zone.GRAVEYARD, playerA, "Island");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Exile");
|
||||
checkStackSize("Shaman's ability should be on the stack", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 1);
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package org.mage.test.cards.triggers;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author Alex-Vasile
|
||||
*/
|
||||
public class GodEternalDiesTriggeredAbilityTest extends CardTestPlayerBase {
|
||||
|
||||
// When God-Eternal Bontu dies or is put into exile from the battlefield,
|
||||
// you may put it into its owner’s library third from the top.
|
||||
private static final String godEternalBontu = "God-Eternal Bontu";
|
||||
|
||||
/**
|
||||
* Test that the ability triggers for dying.
|
||||
*/
|
||||
@Test
|
||||
public void dyingTriggers() {
|
||||
addCard(Zone.HAND, playerA, "Murder");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, godEternalBontu);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murder", godEternalBontu);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, godEternalBontu, 0);
|
||||
assertGraveyardCount(playerA, godEternalBontu, 0);
|
||||
Card card = currentGame.getCard(playerA.getLibrary().getCardList().get(2));
|
||||
Assert.assertEquals(card.getName(), godEternalBontu);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that the ability triggers for exiling.
|
||||
*/
|
||||
@Test
|
||||
public void exilingTriggers() {
|
||||
addCard(Zone.HAND, playerA, "Anguished Unmaking");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains");
|
||||
addCard(Zone.BATTLEFIELD, playerA, godEternalBontu);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Anguished Unmaking", godEternalBontu);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, godEternalBontu, 0);
|
||||
assertExileCount(playerA, godEternalBontu, 0);
|
||||
Card card = currentGame.getCard(playerA.getLibrary().getCardList().get(2));
|
||||
Assert.assertEquals(card.getName(), godEternalBontu);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that the ability does not trigger for bouncing
|
||||
*/
|
||||
@Test
|
||||
public void bounceDoesNotTrigger() {
|
||||
// {1}{U}
|
||||
// Return target creature to its owner’s hand.
|
||||
// You may have Shapeshifters you control become copies of that creature until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Absorb Identity");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, godEternalBontu);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Absorb Identity", godEternalBontu);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, godEternalBontu, 0);
|
||||
assertHandCount(playerA, godEternalBontu, 1);
|
||||
assertLibraryCount(playerA, godEternalBontu, 0);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue