diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/requirement/BlockRequirementTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/requirement/BlockRequirementTest.java index 85bb3f87a38..d7a8819c87d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/requirement/BlockRequirementTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/requirement/BlockRequirementTest.java @@ -225,4 +225,77 @@ public class BlockRequirementTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Dimensional Infiltrator", 1); assertGraveyardCount(playerB, "Llanowar Elves", 1); } + + /* + Reported bug: Challenger Troll on field not enforcing block restrictions + */ + @Test + public void testChallengerTrollTryBlockWithMany() { + /* + Challenger Troll {4}{G} - 6/5 + Creature — Troll + Each creature you control with power 4 or greater can’t be blocked by more than one creature. + */ + String cTroll = "Challenger Troll"; + + String bSable = "Bronze Sable"; // {2} 2/1 + String hGiant = "Hill Giant"; // {3}{R} 3/3 + + addCard(Zone.BATTLEFIELD, playerA, cTroll); + addCard(Zone.BATTLEFIELD, playerB, bSable); + addCard(Zone.BATTLEFIELD, playerB, hGiant); + + attack(1, playerA, cTroll); + + // only 1 should be able to block it since Troll >=4 power block restriction + block(1, playerB, bSable, cTroll); + block(1, playerB, hGiant, cTroll); + + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + + try { + execute(); + fail("Expected exception not thrown"); + } catch (UnsupportedOperationException e) { + assertEquals("Challenger Troll is blocked by 2 creature(s). It can only be blocked by 1 or less.", e.getMessage()); + } + } + + /* + Reported bug: Challenger Troll on field not enforcing block restrictions + */ + @Test + public void testChallengerTrollAndOtherFourPowerCreaturesBlocks() { + /* + Challenger Troll {4}{G} - 6/5 + Creature — Troll + Each creature you control with power 4 or greater can’t be blocked by more than one creature. + */ + String cTroll = "Challenger Troll"; + String bHulk = "Bloom Hulk"; // {3}{G} 4/4 ETB: proliferate + + String bSable = "Bronze Sable"; // {2} 2/1 + String hGiant = "Hill Giant"; // {3}{R} 3/3 + + addCard(Zone.BATTLEFIELD, playerA, cTroll); + addCard(Zone.BATTLEFIELD, playerA, bHulk); + addCard(Zone.BATTLEFIELD, playerB, bSable); + addCard(Zone.BATTLEFIELD, playerB, hGiant); + + attack(1, playerA, cTroll); + attack(1, playerA, bHulk); + + // only 1 should be able to block Bloom Hulk since >=4 power and Troll on field + block(1, playerB, bSable, bHulk); + block(1, playerB, hGiant, bHulk); + + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + + try { + execute(); + fail("Expected exception not thrown"); + } catch (UnsupportedOperationException e) { + assertEquals("Bloom Hulk is blocked by 2 creature(s). It can only be blocked by 1 or less.", e.getMessage()); + } + } }