diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/jou/DeicideTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/jou/DeicideTest.java new file mode 100644 index 0000000000..28fdebe335 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/jou/DeicideTest.java @@ -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); + + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index e737c809dd..ca574fb47a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -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. *