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:
parent
afe9c27aa5
commit
6aa23b0b2e
1 changed files with 30 additions and 24 deletions
|
@ -2,7 +2,6 @@ package org.mage.test.cards.single;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
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???
|
//TODO: why the hell is PermanentImpl.getCounters() and CardImpl.getCounters(game) don't return the same value for the same card???
|
||||||
|
|
||||||
@Test
|
@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, "Island", 7);
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
||||||
addCard(Zone.HAND, playerA, "Chronozoa");
|
addCard(Zone.HAND, playerA, "Chronozoa");
|
||||||
|
@ -31,27 +59,5 @@ public class DustOfMomentsTest extends CardTestPlayerBase {
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chronozoa");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chronozoa");
|
||||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Suspend"); // Casts Deep-Sea Kraken as Suspend
|
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Suspend"); // Casts Deep-Sea Kraken as Suspend
|
||||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dust of Moments");
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue