* Added a test.

This commit is contained in:
LevelX2 2020-08-26 17:02:23 +02:00
parent cf5b474c29
commit 863829085e

View file

@ -1,4 +1,3 @@
package org.mage.test.cards.prevention;
import mage.constants.PhaseStep;
@ -22,11 +21,10 @@ public class PreventAllDamageTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); // (2/2)
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 2); // (2/4)
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
addCard(Zone.HAND, playerB, "Lightning Bolt",2); // Instnat {R}
addCard(Zone.HAND, playerB, "Lightning Bolt", 2); // Instnat {R}
castSpell(2, PhaseStep.UPKEEP, playerA, "Safe Passage");
@ -51,7 +49,6 @@ public class PreventAllDamageTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 20);
}
@Test
@ -64,11 +61,10 @@ public class PreventAllDamageTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); // (2/2)
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); // (2/4)
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
addCard(Zone.HAND, playerB, "Lightning Bolt",1); // Instant {R}
addCard(Zone.HAND, playerB, "Lightning Bolt", 1); // Instant {R}
castSpell(2, PhaseStep.UPKEEP, playerA, "Ethereal Haze");
@ -93,6 +89,57 @@ public class PreventAllDamageTest extends CardTestPlayerBase {
assertLife(playerA, 17);
assertLife(playerB, 20);
}
@Test
public void test_EnergyStorm() {
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
// Cumulative upkeep {1}
// Prevent all damage that would be dealt by instant and sorcery spells.
// Creatures with flying don't untap during their controllers' untap steps.
addCard(Zone.HAND, playerA, "Energy Storm"); // ENCHANTMENT {1}{W}
// Flying, vigilance
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 1); // (2/2)
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // (2/2)
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 4);
addCard(Zone.HAND, playerB, "Lightning Bolt", 2); // Instant {R}
// Fire Ambush deals 3 damage to any target.
addCard(Zone.HAND, playerB, "Fire Ambush", 2); // Sorcery {1}{R}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Energy Storm");
attack(1, playerA, "Abbey Griffin");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Abbey Griffin");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", playerA);
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", "Abbey Griffin");
attack(2, playerB, "Silvercoat Lion");
setChoice(playerA, "No"); // Pay {1}? Energy Storm - CumulativeUpkeepAbility: Cumulative upkeep {1}
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertGraveyardCount(playerA, "Energy Storm", 1);
assertPermanentCount(playerA, "Abbey Griffin", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertGraveyardCount(playerB, "Lightning Bolt", 2);
assertGraveyardCount(playerB, "Fire Ambush", 2);
assertLife(playerA, 18);
assertLife(playerB, 18);
}
}