-
Notifications
You must be signed in to change notification settings - Fork 783
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5888 from jgray1206/boneclad_necromancer_fix
added boneclad necromancer unit tests + fix for issue #5875
- Loading branch information
Showing
2 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
Mage.Tests/src/test/java/org/mage/test/cards/triggers/BonecladNecromancerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package org.mage.test.cards.triggers; | ||
|
||
import mage.constants.PhaseStep; | ||
import mage.constants.Zone; | ||
import org.junit.Test; | ||
import org.mage.test.serverside.base.CardTestPlayerBase; | ||
|
||
/** | ||
* Added this test class to test issue #5875 | ||
* https://github.com/magefree/mage/issues/5875 | ||
* | ||
* Boneclad Necromancer could exile non-creature cards from the graveyard to get his 2/2 Zombie. | ||
* | ||
* Boneclad Necromancer {3}{B}{B} | ||
* | ||
* Card Type: Creature — Human Wizard | ||
* P / T: 3 / 3 | ||
* Description: When Boneclad Necromancer enters the battlefield, you may exile target creature card from a graveyard. | ||
* If you do, create a 2/2 black Zombie creature token. | ||
* | ||
* @author jgray1206 | ||
*/ | ||
public class BonecladNecromancerTest extends CardTestPlayerBase { | ||
|
||
@Test | ||
public void testBonecladNecromancerCanExileCreaturesFromOwnGraveyard() { | ||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); | ||
addCard(Zone.HAND, playerA, "Boneclad Necromancer", 1); | ||
addCard(Zone.GRAVEYARD, playerA, "Raptor Hatchling", 1); | ||
|
||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boneclad Necromancer"); | ||
playerA.addChoice("Raptor Hatchling"); | ||
setStopAt(1, PhaseStep.BEGIN_COMBAT); | ||
execute(); | ||
|
||
assertPermanentCount(playerA, "Boneclad Necromancer", 1); | ||
assertPermanentCount(playerA, "Zombie", 1); | ||
assertExileCount(playerA, "Raptor Hatchling", 1); | ||
assertGraveyardCount(playerA, "Raptor Hatchling", 0); | ||
} | ||
|
||
@Test | ||
public void testBonecladNecromancerCanExileCreaturesFromOtherGraveyard() { | ||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); | ||
addCard(Zone.HAND, playerA, "Boneclad Necromancer", 1); | ||
addCard(Zone.GRAVEYARD, playerB, "Raptor Hatchling", 1); | ||
|
||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boneclad Necromancer"); | ||
playerA.addChoice("Raptor Hatchling"); | ||
setStopAt(1, PhaseStep.BEGIN_COMBAT); | ||
execute(); | ||
|
||
assertPermanentCount(playerA, "Boneclad Necromancer", 1); | ||
assertPermanentCount(playerA, "Zombie", 1); | ||
assertExileCount(playerB, "Raptor Hatchling", 1); | ||
assertGraveyardCount(playerB, "Raptor Hatchling", 0); | ||
} | ||
|
||
@Test | ||
public void testBonecladNecromancerCantExileNonCreatures() { | ||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); | ||
addCard(Zone.HAND, playerA, "Boneclad Necromancer", 1); | ||
addCard(Zone.GRAVEYARD, playerA, "Feral Invocation", 1); | ||
|
||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boneclad Necromancer"); | ||
playerA.addChoice("Feral Invocation"); | ||
setStopAt(1, PhaseStep.BEGIN_COMBAT); | ||
execute(); | ||
|
||
assertPermanentCount(playerA, "Boneclad Necromancer", 1); | ||
assertPermanentCount(playerA, "Zombie", 0); | ||
assertExileCount(playerA, "Feral Invocation", 0); | ||
assertGraveyardCount(playerA, "Feral Invocation", 1); | ||
|
||
} | ||
|
||
} |