the card should still be exiled.

added a method to test exile count per player
added a test for chandrapyromaster
This commit is contained in:
ingmargoudt 2017-02-19 09:09:43 +01:00
parent d729ab31d2
commit 9ea690797f
4 changed files with 55 additions and 9 deletions

View file

@ -43,6 +43,29 @@ public class ChandraPyromasterTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
}
@Test
public void testAbility2AncestralVision() {
addCard(Zone.BATTLEFIELD, playerA, "Chandra, Pyromaster");
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancestral Vision");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+0: Exile the top card of your library. You may play it this turn.");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Chandra, Pyromaster", 1);
assertGraveyardCount(playerA, "Ancestral Vision", 0);
assertExileCount(playerA, "Ancestral Vision", 1);
}
@Test
public void testAbility2CastCardFromExileWithOverlaod() {

View file

@ -860,6 +860,25 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
Assert.assertEquals("(Exile) Card counts for player " + owner.getName() + " is not equal.", count, actualCount);
}
/**
* Assert card count in player's graveyard.
*
* @param owner {@link Player} who's graveyard should be counted.
* @param cardName Name of the cards that should be counted.
* @param count Expected count.
*/
public void assertExileCount(Player owner, String cardName, int count) throws AssertionError {
int actualCount = 0;
for (ExileZone exile : currentGame.getExile().getExileZones()) {
for (Card card : exile.getCards(currentGame)) {
if (card.getOwnerId().equals(owner.getId()) && card.getName().equals(cardName)) {
actualCount++;
}
}
}
Assert.assertEquals("(Exile " + owner.getName() + ") Card counts are not equal (" + cardName + ')', count, actualCount);
}
/**
* Assert card count in player's graveyard.
*