mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Merge pull request #5783 from drmDev/ut/BlockTrollTests
UTs added for Challenger Troll block restrictions. closes #5730
This commit is contained in:
commit
3d3960c5f7
1 changed files with 73 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue