Merge pull request #3295 from ingmargoudt/triumph_hordes_unittest

Triumph hordes unittest
This commit is contained in:
Derek M 2017-05-03 07:53:47 -04:00 committed by GitHub
commit 03237aa2fe
2 changed files with 37 additions and 7 deletions

View file

@ -27,29 +27,32 @@
*/
package mage.cards.t;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.InfectAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import java.util.UUID;
/**
*
* @author North
*/
public class TriumphOfTheHordes extends CardImpl {
private FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent();
public TriumphOfTheHordes(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}");
this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(InfectAbility.getInstance(), Duration.EndOfTurn));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, filterCreaturePermanent));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(InfectAbility.getInstance(), Duration.EndOfTurn, filterCreaturePermanent));
}
public TriumphOfTheHordes(final TriumphOfTheHordes card) {

View file

@ -0,0 +1,27 @@
package org.mage.test.cards.single;
import mage.abilities.keyword.InfectAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class TriumphOfTheHordesTest extends CardTestPlayerBase {
//issue 3292, Triumph of the Hordes gives a Chromatic Lantern Infect + Trample
@Test
public void triumphOfTheHordesNonCreatureTest() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 10);
addCard(Zone.BATTLEFIELD, playerA, "Chromatic Lantern", 1);
addCard(Zone.HAND, playerA, "Triumph of the Hordes", 1);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Triumph of the Hordes");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAbility(playerA, "Chromatic Lantern", InfectAbility.getInstance(), false);
assertAbility(playerA, "Grizzly Bears", InfectAbility.getInstance(), true);
}
}