added empty test for DustOfMoments

This commit is contained in:
glerman 2015-06-29 02:09:56 +03:00 committed by Gal Lerman
parent 9e4a7aad8a
commit 45e269de77
2 changed files with 47 additions and 3 deletions

View file

@ -58,14 +58,16 @@ public class DustOfMoments extends CardImpl {
super(ownerId, 5, "Dust of Moments", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); super(ownerId, 5, "Dust of Moments", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}");
this.expansionSetCode = "FUT"; this.expansionSetCode = "FUT";
// Choose one // Choose one - Remove two time counters from each permanent and each suspended card
// Remove two time counters from each permanent and each suspended card
final Counter counter = new Counter(CounterType.TIME.getName(), 2); final Counter counter = new Counter(CounterType.TIME.getName(), 2);
this.getSpellAbility().addEffect(new AddRemoveAllTimeSuspentCountersEffect(counter, filter, true)); this.getSpellAbility().addEffect(new AddRemoveAllTimeSuspentCountersEffect(counter, filter, true));
// Or put two time counters on each permanent with a time counter on it and each suspended card // Or put two time counters on each permanent with a time counter on it and each suspended card
Mode mode = new Mode(); Mode mode = new Mode();
mode.getEffects().add(new AddRemoveAllTimeSuspentCountersEffect(counter, filter, false)); mode.getEffects().add(new AddRemoveAllTimeSuspentCountersEffect(counter, filter, false));
this.getSpellAbility().getModes().addMode(mode); this.getSpellAbility().getModes().addMode(mode);
this.getSpellAbility().getModes().setMaxModes(1);
this.getSpellAbility().getModes().setMinModes(1);
} }
public DustOfMoments(final DustOfMoments card) { public DustOfMoments(final DustOfMoments card) {

View file

@ -1,9 +1,51 @@
package org.mage.test.cards.single; 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;
import mage.counters.CounterType;
import mage.game.permanent.Permanent;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
/** /**
* Created by glerman on 29/6/15. * Created by glerman on 29/6/15.
*/ */
public class DustOfMomentsTest extends CardTestPlayerBase{ public class DustOfMomentsTest extends CardTestPlayerBase {
@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");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Deep-Sea Kraken");
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dust Of Moments");
setModeChoice(playerA, "1");
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
final List<Permanent> activeCreatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE);
Assert.assertEquals(2, activeCreatures.size());
for (final Permanent creature : activeCreatures) {
Assert.assertEquals("Chronozoa", creature.getName());
}
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);
}
} }