Tests: fixed EchoTest

This commit is contained in:
Oleg Agafonov 2018-11-21 16:56:31 +04:00
parent be225f7def
commit f86cfe9e3d

View file

@ -1,4 +1,3 @@
package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
@ -7,29 +6,27 @@ import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class EchoTest extends CardTestPlayerBase {
/*
* I flickered an Avalanche Riders with its Echo trigger on the stack with Restoration Angel.
* When the trigger resolved, my Riders was sacrificed, even though it should have been
* considered a new permanent.
*/
/*
* I flickered an Avalanche Riders with its Echo trigger on the stack with Restoration Angel.
* When the trigger resolved, my Riders was sacrificed, even though it should have been
* considered a new permanent.
*/
@Test
public void testEchoTriggerChecksIdentity() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
// Avalanche Riders Creature - Human Nomad 2/2
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// Avalanche Riders Creature - Human Nomad 2/2 {3}{R}
// Haste
// Echo (At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep, sacrifice it unless you pay its echo cost.)
// When Avalanche Riders enters the battlefield, destroy target land.
addCard(Zone.HAND, playerA, "Avalanche Riders");
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
// Restoration Angel {3}{W}
// Flash
// Flying
@ -37,12 +34,19 @@ public class EchoTest extends CardTestPlayerBase {
// then return that card to the battlefield under your control.
addCard(Zone.HAND, playerA, "Restoration Angel");
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
// cast Avalanche Riders and destroy forest
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Avalanche Riders");
addTarget(playerA, "Forest");
// Avalanche Riders go to echo, cast Restoration Angel to restore rider (do not apply echo with 4 mana)
activateManaAbility(3, PhaseStep.UPKEEP, playerA, "{T}: Add {W}");
activateManaAbility(3, PhaseStep.UPKEEP, playerA, "{T}: Add {W}");
activateManaAbility(3, PhaseStep.UPKEEP, playerA, "{T}: Add {W}");
activateManaAbility(3, PhaseStep.UPKEEP, playerA, "{T}: Add {W}");
castSpell(3, PhaseStep.UPKEEP, playerA, "Restoration Angel", null, "Echo {3}{R} <i>(At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep, sacrifice it unless you pay its echo cost.)</i>");
addTarget(playerA, "Avalanche Riders");
setChoice(playerA, "Yes"); // raider do restore
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
@ -52,7 +56,9 @@ public class EchoTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Avalanche Riders", 1);
assertPermanentCount(playerA, "Restoration Angel", 1);
assertPermanentCount(playerB, "Mountain", 0);
assertPermanentCount(playerB, "Forest", 0);
assertTappedCount("Plains", true, 4);
assertTappedCount("Mountain", true, 0);
}