3 Curses from DKA

This commit is contained in:
BetaSteward 2012-02-19 09:52:39 -05:00
parent 6828f1d651
commit 828662f6f3
8 changed files with 582 additions and 0 deletions

View file

@ -0,0 +1,31 @@
package org.mage.test.cards;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class TestCurseOfBloodletting extends CardTestPlayerBase {
@Test
public void testCard1() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 7);
addCard(Constants.Zone.HAND, playerA, "Curse of Bloodletting");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt", 2);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB);
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerA);
setStopAt(1, Constants.PhaseStep.END_TURN);
execute();
assertLife(playerA, 17);
assertLife(playerB, 14);
}
}

View file

@ -0,0 +1,30 @@
package org.mage.test.cards;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class TestCurseOfEchoes extends CardTestPlayerBase {
@Test
public void testCard1() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 5);
addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 5);
addCard(Constants.Zone.HAND, playerA, "Curse of Echoes");
addCard(Constants.Zone.HAND, playerB, "Jace's Ingenuity");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Echoes", playerB);
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Jace's Ingenuity");
setStopAt(1, Constants.PhaseStep.END_TURN);
execute();
assertHandCount(playerA, 3);
assertHandCount(playerB, 3);
}
}

View file

@ -0,0 +1,51 @@
package org.mage.test.cards;
import mage.Constants;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class TestCurseOfExhaustion extends CardTestPlayerBase {
@Test
public void testCard1() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Constants.Zone.HAND, playerA, "Curse of Exhaustion");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 2);
addCard(Constants.Zone.HAND, playerB, "Lightning Bolt", 2);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB);
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
setStopAt(1, Constants.PhaseStep.END_TURN);
execute();
assertLife(playerB, 20);
assertLife(playerA, 17);
}
@Test
public void testCard2() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Constants.Zone.HAND, playerA, "Curse of Exhaustion");
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt", 2);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB);
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, Constants.PhaseStep.END_TURN);
execute();
assertLife(playerA, 20);
assertLife(playerB, 14);
}
}

View file

@ -352,6 +352,17 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount);
}
/**
* Assert card count in player's hand.
*
* @param player {@link Player} who's hand should be counted.
* @param count Expected count.
*/
public void assertHandCount(Player player, int count) throws AssertionError {
int actual = currentGame.getPlayer(player.getId()).getHand().size();
Assert.assertEquals("(Hand) Card counts are not equal ", count, actual);
}
/**
* Assert card count in player's graveyard.
*