2 tests for unimplemented Harm's Way

This commit is contained in:
magenoxx 2012-05-24 18:29:12 +04:00
parent 0890d6e57f
commit 099e152445

View file

@ -0,0 +1,62 @@
package org.mage.test.cards.replacement.prevent;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* Harm's Way:
* The next 2 damage that a source of your choice would deal to you and/or permanents you control this turn is dealt to target creature or player instead.
*
* @author noxx
*/
public class HarmsWayRedirectDamageTest extends CardTestPlayerBase {
/**
* Tests that 2 of 3 damage is redirected while 1 damage is still dealt to original target
*/
@Test
public void testRedirectTwoDamage() {
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Constants.Zone.HAND, playerB, "Harm's Way");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Plains");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerB, "Harm's Way", "Lightning Bolt^targetPlayer=PlayerA");
setStopAt(1, Constants.PhaseStep.END_TURN);
execute();
// 2 damage was redirected back
assertLife(playerA, 18);
// 1 damage was still dealt
assertLife(playerB, 19);
}
/**
* Tests redirecting combat damage
*/
@Test
public void testRedirectCombatDamage() {
addCard(Constants.Zone.HAND, playerA, "Harm's Way");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm");
attack(2, playerB, "Craw Wurm");
castSpell(2, Constants.PhaseStep.DECLARE_BLOCKERS, playerA, "Harm's Way", "Craw Wurm^targetPlayer=PlayerB");
setStopAt(2, Constants.PhaseStep.END_TURN);
execute();
// only 4 combat damage
assertLife(playerA, 16);
// 2 damage is redirected
assertLife(playerB, 18);
}
}