From db2a556fca06c750b257f677a69bbfbe36f54e29 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 9 Feb 2020 07:52:24 +0400 Subject: [PATCH] Additional comments and tests for #6268 --- .../cards/continuous/IrencragFeatTest.java | 61 ++++++++++++++++++- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java index 3bd183eb291..93f09009b9e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java @@ -6,6 +6,12 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; public class IrencragFeatTest extends CardTestPlayerBase { + + /* + Irencrag Feat + Add seven {R}. You can cast only one more spell this turn. + */ + @Test public void castFirst() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10); @@ -15,9 +21,11 @@ public class IrencragFeatTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Irencrag Feat"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); + setStrictChooseMode(true); + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); + //assertAllCommandsUsed(); // second trader must be restricted to cast assertHandCount(playerA, "Dwarven Trader", 1); assertPermanentCount(playerA, "Dwarven Trader", 1); @@ -35,14 +43,59 @@ public class IrencragFeatTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Irencrag Feat"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); + setStrictChooseMode(true); + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); + //assertAllCommandsUsed(); // second trader must be restricted to cast assertHandCount(playerA, "Dwarven Trader", 1); assertPermanentCount(playerA, "Dwarven Trader", 3); } + @Test + public void castThirdOnStack() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10); + addCard(Zone.HAND, playerA, "Irencrag Feat", 1); + addCard(Zone.HAND, playerA, "Lightning Bolt", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Irencrag Feat"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + assertAllCommandsUsed(); + + assertHandCount(playerA, "Lightning Bolt", 0); + assertLife(playerB, 20 - 4 * 3); + } + + @Test + public void castThirdNotOnStack() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10); + addCard(Zone.HAND, playerA, "Irencrag Feat", 1); + addCard(Zone.HAND, playerA, "Lightning Bolt", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Irencrag Feat"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + //assertAllCommandsUsed(0); // second bolt must be restricted to cast + + assertHandCount(playerA, "Lightning Bolt", 4 - 3); + assertLife(playerB, 20 - 3 * 3); + } + @Test public void nextTurn() { @@ -55,9 +108,11 @@ public class IrencragFeatTest extends CardTestPlayerBase { castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); - setStopAt(3, PhaseStep.BEGIN_COMBAT); + setStrictChooseMode(true); + setStopAt(3, PhaseStep.BEGIN_COMBAT); execute(); + assertAllCommandsUsed(); assertHandCount(playerA, "Dwarven Trader", 0); assertPermanentCount(playerA, "Dwarven Trader", 4);