This commit is contained in:
BetaSteward 2012-03-08 13:54:31 -05:00
parent e03aaee4b6
commit f1fefb0d59
12 changed files with 463 additions and 190 deletions

View file

@ -1,31 +0,0 @@
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

@ -1,30 +0,0 @@
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

@ -1,51 +0,0 @@
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

@ -1,44 +0,0 @@
package org.mage.test.cards;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class TestCurseOfThirst extends CardTestPlayerBase {
@Test
public void testCard1() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
setStopAt(2, Constants.PhaseStep.DRAW);
execute();
assertLife(playerA, 20);
assertLife(playerB, 19);
}
@Test
public void testCard2() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5);
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
addCard(Constants.Zone.HAND, playerA, "Curse of Bloodletting");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
setStopAt(2, Constants.PhaseStep.DRAW);
execute();
assertLife(playerA, 20);
assertLife(playerB, 16);
}
}

View file

@ -0,0 +1,151 @@
package org.mage.test.cards;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class TestCurses extends CardTestPlayerBase {
@Test
public void testCurseOfBloodletting() {
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);
}
@Test
public void testCurseOfEchoes() {
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);
}
@Test
public void testCurseOfExhaustion1() {
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 testCurseOfExhaustion2() {
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);
}
@Test
public void testCurseOfThirst1() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
setStopAt(2, Constants.PhaseStep.DRAW);
execute();
assertLife(playerA, 20);
assertLife(playerB, 19);
}
@Test
public void testCurseOfThirst2() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5);
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
addCard(Constants.Zone.HAND, playerA, "Curse of Bloodletting");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
setStopAt(2, Constants.PhaseStep.DRAW);
execute();
assertLife(playerA, 20);
assertLife(playerB, 16);
}
@Test
public void testCurseOfMisfortune1() {
removeAllCardsFromLibrary(playerA);
addCard(Constants.Zone.LIBRARY, playerA, "Curse of Misfortunes", 2);
addCard(Constants.Zone.HAND, playerA, "Curse of Misfortunes");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Misfortunes", playerB);
setStopAt(3, Constants.PhaseStep.DRAW);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Curse of Misfortunes", 1);
}
@Test
public void testCurseOfMisfortune2() {
removeAllCardsFromLibrary(playerA);
addCard(Constants.Zone.LIBRARY, playerA, "Curse of Bloodletting", 2);
addCard(Constants.Zone.HAND, playerA, "Curse of Misfortunes");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Misfortunes", playerB);
setStopAt(3, Constants.PhaseStep.DRAW);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Curse of Misfortunes", 1);
assertPermanentCount(playerA, "Curse of Bloodletting", 1); }
}

View file

@ -0,0 +1,62 @@
package org.mage.test.cards;
import junit.framework.Assert;
import mage.Constants;
import mage.filter.Filter;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class TestSuddenDisappearance extends CardTestPlayerBase {
@Test
public void testCard() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 6);
addCard(Constants.Zone.HAND, playerA, "Sudden Disappearance");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 1);
addCard(Constants.Zone.BATTLEFIELD, playerB, "Horned Turtle", 4);
addCard(Constants.Zone.BATTLEFIELD, playerB, "Altar of the Lost", 1);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Sudden Disappearance", playerB);
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerB, "Air Elemental", 0);
assertPermanentCount(playerB, "Horned Turtle", 0);
assertPermanentCount(playerB, "Altar of the Lost", 0);
assertExileCount("Air Elemental", 1);
assertExileCount("Horned Turtle", 4);
assertExileCount("Altar of the Lost", 1);
}
@Test
public void testCard1() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 6);
addCard(Constants.Zone.HAND, playerA, "Sudden Disappearance");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 1);
addCard(Constants.Zone.BATTLEFIELD, playerB, "Horned Turtle", 4);
addCard(Constants.Zone.BATTLEFIELD, playerB, "Altar of the Lost", 1);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Sudden Disappearance", playerB);
setStopAt(2, Constants.PhaseStep.UPKEEP);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerB, "Air Elemental", 1);
assertPermanentCount(playerB, "Horned Turtle", 4);
assertPermanentCount(playerB, "Altar of the Lost", 1);
assertExileCount("Air Elemental", 0);
assertExileCount("Horned Turtle", 0);
assertExileCount("Altar of the Lost", 0);
}
}

View file

@ -260,7 +260,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
*/
public void assertLife(Player player, int life) throws AssertionError {
int actual = currentGame.getPlayer(player.getId()).getLife();
Assert.assertEquals("Life amounts are not equal", life, actual);
Assert.assertEquals("Life amounts are not equal for player " + player.getName(), life, actual);
}
/**