mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Add Deicide Test
This commit is contained in:
parent
d8bbd10733
commit
45a50d9707
2 changed files with 52 additions and 0 deletions
|
@ -0,0 +1,33 @@
|
|||
package org.mage.test.cards.single.jou;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class DeicideTest extends CardTestPlayerBase {
|
||||
|
||||
// #7661
|
||||
@Test
|
||||
public void targetNonCreatureeGod() {
|
||||
// Exile target enchantment. If the exiled card is a God card, search its controller's graveyard, hand,
|
||||
// and library for any number of cards with the same name as that card and exile them, then that player shuffles their library.
|
||||
addCard(Zone.HAND, playerA, "Deicide");
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Heliod, Sun-Crowned");
|
||||
// add for Devotion {W}{W} x 3
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Crusade", 3);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Deicide", "Heliod, Sun-Crowned");
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
assertExiledCardSubtype("Heliod, Sun-Crowned", SubType.GOD);
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1354,6 +1354,25 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
Assert.assertEquals("(Graveyard) Card counts are not equal ", count, actual);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert card subtype in exile.
|
||||
*
|
||||
* @param cardName Name of the card.
|
||||
* @param subType Expected subtype.
|
||||
*/
|
||||
public void assertExiledCardSubtype(String cardName, SubType subType) throws AssertionError {
|
||||
boolean found = false;
|
||||
for (ExileZone exile : currentGame.getExile().getExileZones()) {
|
||||
for (Card card : exile.getCards(currentGame)) {
|
||||
if(CardUtil.haveSameNames(card.getName(), cardName, true) && card.hasSubtype(subType, currentGame)){
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Assert.assertTrue("There is no card named " + cardName + " found in exile, with subtype " + subType, found);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert card count in exile.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue