Skip to content

Commit

Permalink
Merge pull request #5888 from jgray1206/boneclad_necromancer_fix
Browse files Browse the repository at this point in the history
added boneclad necromancer unit tests + fix for issue #5875
  • Loading branch information
JayDi85 authored Jul 8, 2019
2 parents 79d4075 + 1d0da97 commit aa1ebd7
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/b/BonecladNecromancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.game.permanent.token.ZombieToken;
import mage.target.common.TargetCardInGraveyard;

Expand All @@ -20,7 +20,7 @@
*/
public final class BonecladNecromancer extends CardImpl {

private static final FilterCard filter = new FilterCard("creature card from a graveyard");
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card from a graveyard");

public BonecladNecromancer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
Expand Down
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);

}

}

0 comments on commit aa1ebd7

Please sign in to comment.