From 126898f70a30a67ae0b41f856093813b2ed93809 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Thu, 2 Jul 2020 01:25:19 +0400 Subject: [PATCH] Added test for #4499 --- .../cards/abilities/keywords/AfflictTest.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AfflictTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AfflictTest.java index c0fea22a22..d5c2da1270 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AfflictTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AfflictTest.java @@ -19,8 +19,29 @@ public class AfflictTest extends CardTestPlayerBase { attack(1, playerA, khenra); block(1, playerB, elves, khenra); + setStrictChooseMode(true); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertAllCommandsUsed(); + + assertLife(playerB, 19); + } + + @Test + public void testBecomesDoubleBlocked() { + addCard(Zone.BATTLEFIELD, playerA, khenra); + addCard(Zone.BATTLEFIELD, playerB, elves, 2); + + // afflict must trigger only once + attack(1, playerA, khenra); + block(1, playerB, elves + ":0", khenra); + block(1, playerB, elves + ":1", khenra); + setChoice(playerA, "X=1"); // assign damage + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + execute(); + assertAllCommandsUsed(); assertLife(playerB, 19); @@ -28,17 +49,17 @@ public class AfflictTest extends CardTestPlayerBase { @Test public void testNotBlocked() { - addCard(Zone.BATTLEFIELD, playerA, khenra); addCard(Zone.BATTLEFIELD, playerB, elves); attack(1, playerA, khenra); + setStrictChooseMode(true); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertAllCommandsUsed(); assertLife(playerB, 18); - } // My afflict didn't come through after using Endless Sands on my own creature. The afflict ability was on the stack already. @@ -62,9 +83,11 @@ public class AfflictTest extends CardTestPlayerBase { attack(1, playerA, "Frontline Devastator"); block(1, playerB, "Ruin Rat", "Frontline Devastator"); + setStrictChooseMode(true); activateAbility(1, PhaseStep.DECLARE_BLOCKERS, playerA, "{2},", "Frontline Devastator"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertAllCommandsUsed(); assertExileCount(playerA, "Frontline Devastator", 1); assertPermanentCount(playerB, "Ruin Rat", 1);