1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-03 17:00:16 -09:00

added DustOfMoments counter addition test

This commit is contained in:
glerman 2015-07-03 02:27:49 +03:00 committed by Gal Lerman
parent afe9c27aa5
commit 6aa23b0b2e

View file

@ -2,7 +2,6 @@ package org.mage.test.cards.single;
import java.util.List;
import mage.cards.Card;
import mage.constants.CardType;
import mage.constants.PhaseStep;
import mage.constants.Zone;
@ -21,7 +20,36 @@ public class DustOfMomentsTest extends CardTestPlayerBase {
//TODO: why the hell is PermanentImpl.getCounters() and CardImpl.getCounters(game) don't return the same value for the same card???
@Test
public void test() throws Exception {
public void testRemoveCounters() throws Exception {
initGame();
setModeChoice(playerA, "1"); // Chose the remove 2 time counters option
setStopAt(3, PhaseStep.END_TURN);
execute();
// Chronozoa should have duplicated
final List<Permanent> activeCreatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE);
Assert.assertEquals(2, activeCreatures.size());
for (final Permanent creature : activeCreatures) {
Assert.assertEquals("Chronozoa", creature.getName());
Assert.assertEquals(3, creature.getCounters().getCount(CounterType.TIME));
}
// Check time counters on kraken
assertCounterOnExiledCardCount("Deep-Sea Kraken", CounterType.TIME, 6);
}
@Test
public void testAddCounters() throws Exception {
initGame();
setModeChoice(playerA, "2"); // Chose the add 2 time counters option
setStopAt(3, PhaseStep.END_TURN);
execute();
assertCounterCount("Chronozoa", CounterType.TIME, 4);
assertCounterOnExiledCardCount("Deep-Sea Kraken", CounterType.TIME, 10);
}
private void initGame() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 7);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.HAND, playerA, "Chronozoa");
@ -31,27 +59,5 @@ public class DustOfMomentsTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chronozoa");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Suspend"); // Casts Deep-Sea Kraken as Suspend
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dust of Moments");
setModeChoice(playerA, "1");
setStopAt(3, PhaseStep.END_TURN);
execute();
// Chronozoa should have duplicated
final List<Permanent> activeCreatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE);
Assert.assertEquals(2, activeCreatures.size());
for (final Permanent creature : activeCreatures) {
Assert.assertEquals("Chronozoa", creature.getName());
Assert.assertEquals(3, creature.getCounters().getCount(CounterType.TIME));
}
// Check time counters on kraken
final List<Card> exiledCards = currentGame.getExile().getAllCards(currentGame);
Assert.assertEquals(1, exiledCards.size());
final Card kraken = exiledCards.get(0);
final int krakenCounters = kraken.getCounters(currentGame).getCount(CounterType.TIME);
Assert.assertEquals(6, krakenCounters);
}
}