[AVR] 3 cards + tests for filter and dies triggered ability

This commit is contained in:
magenoxx 2012-05-08 14:44:46 +04:00
parent be7f01b0ba
commit 59a72e974a
6 changed files with 482 additions and 0 deletions

View file

@ -0,0 +1,48 @@
package org.mage.test.cards.filters;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author noxx
*/
public class MassAppealTest extends CardTestPlayerBase {
@Test
public void testNoDraw() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Constants.Zone.HAND, playerA, "Mass Appeal");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Mass Appeal");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertHandCount(playerA, 0);
assertHandCount(playerB, 0);
}
@Test
public void testNoDrawCards() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Constants.Zone.BATTLEFIELD, playerA, "Ana Disciple", 2);
addCard(Constants.Zone.BATTLEFIELD, playerA, "Alabaster Mage", 3);
addCard(Constants.Zone.HAND, playerA, "Mass Appeal");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Ana Disciple", 6);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Mass Appeal");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertHandCount(playerA, 5);
assertHandCount(playerB, 0);
}
}

View file

@ -0,0 +1,55 @@
package org.mage.test.cards.triggers.dies;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author noxx
*
* When Rotcrown Ghoul dies, target player puts the top five cards of his or her library into his or her graveyard.
*/
public class RotcrownGhoulTest extends CardTestPlayerBase {
@Test
public void testDiesTriggeredAbility() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Rotcrown Ghoul", 1);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Rotcrown Ghoul");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
// Lightning Bolt + 5 cards
assertGraveyardCount(playerA, 6);
// Rotcrown Ghoul
assertGraveyardCount(playerB, 1);
}
@Test
public void testDiesTriggeredAbilityForTwoCopies() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Rotcrown Ghoul", 2);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Rotcrown Ghoul");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
// Lightning Bolt + 5 cards
assertGraveyardCount(playerA, 6);
// Rotcrown Ghoul
assertGraveyardCount(playerB, 1);
}
}

View file

@ -0,0 +1,88 @@
package org.mage.test.cards.triggers.dies;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author noxx
*
* Whenever Selhoff Occultist or another creature dies, target player puts the top card of his or her library into his or her graveyard.
*/
public class SelhoffOccultistTest extends CardTestPlayerBase {
/**
* Tests Selhoff Occultist's ability triggered
*/
@Test
public void testDiesTriggeredAbility() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Selhoff Occultist", 1);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Selhoff Occultist");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
// Lightning Bolt + 1 card
assertGraveyardCount(playerA, 2);
// Selhoff Occultist
assertGraveyardCount(playerB, 1);
}
/**
* Tests that both Selhoff Occultist would trigger
*/
@Test
public void testDiesTriggeredAbilityForTwoCopies() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Selhoff Occultist", 2);
addCard(Constants.Zone.BATTLEFIELD, playerB, "Ana Disciple", 1);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Ana Disciple");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
// Lightning Bolt + 2 cards
assertGraveyardCount(playerA, 3);
// Ana Disciple
assertGraveyardCount(playerB, 1);
}
/**
* Tests that Selhoff Occultist cards in other than battlefield zones don't cause any effect
*/
@Test
public void testDiesTriggeredAbilityInOtherZone() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Selhoff Occultist", 2);
addCard(Constants.Zone.HAND, playerB, "Selhoff Occultist", 1);
addCard(Constants.Zone.GRAVEYARD, playerB, "Selhoff Occultist", 1);
addCard(Constants.Zone.BATTLEFIELD, playerB, "Ana Disciple", 1);
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Ana Disciple");
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
// Lightning Bolt + 2 cards
assertGraveyardCount(playerA, 3);
// Selhoff Occultist + Ana Disciple
assertGraveyardCount(playerB, 2);
}
}