1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-14 09:09:38 -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,19 +20,9 @@ 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 {
addCard(Zone.BATTLEFIELD, playerA, "Island", 7);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.HAND, playerA, "Chronozoa");
addCard(Zone.HAND, playerA, "Deep-Sea Kraken");
addCard(Zone.HAND, playerA, "Dust of Moments");
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");
public void testRemoveCounters() throws Exception {
initGame();
setModeChoice(playerA, "1"); // Chose the remove 2 time counters option
setStopAt(3, PhaseStep.END_TURN);
execute();
@ -45,13 +34,30 @@ public class DustOfMomentsTest extends CardTestPlayerBase {
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());
assertCounterOnExiledCardCount("Deep-Sea Kraken", CounterType.TIME, 6);
}
final Card kraken = exiledCards.get(0);
final int krakenCounters = kraken.getCounters(currentGame).getCount(CounterType.TIME);
Assert.assertEquals(6, krakenCounters);
@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");
addCard(Zone.HAND, playerA, "Deep-Sea Kraken");
addCard(Zone.HAND, playerA, "Dust of Moments");
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");
}
}