From 38b54beb54ae7bb0235bce07c1e523fb110b7d8e Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 14 Dec 2024 18:49:34 +0400 Subject: [PATCH] tests: added Grand Abolisher tests for #13099 --- .../cards/single/m12/GrandAbolisherTest.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/m12/GrandAbolisherTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/GrandAbolisherTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/GrandAbolisherTest.java new file mode 100644 index 00000000000..36bbd128649 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/GrandAbolisherTest.java @@ -0,0 +1,54 @@ +package org.mage.test.cards.single.m12; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author JayDi85 + */ +public class GrandAbolisherTest extends CardTestPlayerBase { + + @Test + public void test_MakeSureItWorksFromBattlefieldOnly() { + skipInitShuffling(); + + // related bug: #13099 + String castAbility = "Cast Consider"; + + // During your turn, your opponents can't cast spells or activate abilities of artifacts, creatures, or enchantments. + addCard(Zone.LIBRARY, playerB, "Grand Abolisher", 1); // {W}{W} + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + // + // Draw a card. + addCard(Zone.HAND, playerA, "Consider", 1); // {U} + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + + String info = "turn 1 (opponent, in library - no restriction)"; + checkHandCardCount(info, 1, PhaseStep.PRECOMBAT_MAIN, playerB, "Grand Abolisher", 0); + checkPlayableAbility(info, 1, PhaseStep.POSTCOMBAT_MAIN, playerA, castAbility, true); + + info = "turn 2 (own, in hand - no restriction)"; + checkHandCardCount(info, 2, PhaseStep.PRECOMBAT_MAIN, playerB, "Grand Abolisher", 1); + checkPlayableAbility(info, 2, PhaseStep.POSTCOMBAT_MAIN, playerA, castAbility, true); + + info = "turn 3 (opponent, in hand - no restriction)"; + checkHandCardCount(info, 3, PhaseStep.PRECOMBAT_MAIN, playerB, "Grand Abolisher", 1); + checkPlayableAbility(info, 3, PhaseStep.POSTCOMBAT_MAIN, playerA, castAbility, true); + + info = "turn 4 (own, in battlefield - must have restriction)"; + castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Grand Abolisher"); + waitStackResolved(4, PhaseStep.PRECOMBAT_MAIN); + checkPermanentCount(info, 4, PhaseStep.PRECOMBAT_MAIN, playerB, "Grand Abolisher", 1); + checkPlayableAbility(info, 4, PhaseStep.POSTCOMBAT_MAIN, playerA, castAbility, false); + + info = "turn 5 (opponent, in battlefield - no restriction)"; + checkPermanentCount(info, 5, PhaseStep.PRECOMBAT_MAIN, playerB, "Grand Abolisher", 1); + checkPlayableAbility(info, 5, PhaseStep.POSTCOMBAT_MAIN, playerA, castAbility, true); + + setStrictChooseMode(true); + setStopAt(5, PhaseStep.END_TURN); + execute(); + } +}