forked from External/mage
increase test coverage for sacrifice effects
This commit is contained in:
parent
985390b7c3
commit
abe8a4356e
3 changed files with 160 additions and 0 deletions
|
|
@ -0,0 +1,44 @@
|
|||
package org.mage.test.cards.single.lci;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
||||
public class DireBlunderbussTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Dire Blunderbuss
|
||||
Color Indicator: RedArtifact — Equipment
|
||||
|
||||
Equipped creature gets +3/+0 and has “Whenever this creature attacks, you may sacrifice an artifact other than Dire Blunderbuss. When you do, this creature deals damage equal to its power to target creature.”
|
||||
|
||||
Equip {1}
|
||||
*/
|
||||
private static final String direBlunderBuss = "Dire Blunderbuss";
|
||||
|
||||
@Test
|
||||
public void DireBlunderbussTest() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest");
|
||||
addCard(Zone.BATTLEFIELD, playerA, direBlunderBuss);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Balduvian Bears@bearsB");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Tormod's Crypt");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Balduvian Bears");
|
||||
|
||||
attack(1, playerA, "Balduvian Bears");
|
||||
setChoice(playerA, true);
|
||||
setChoice(playerA, "Tormod's Crypt");
|
||||
addTarget(playerA, "@bearsB");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerB, "Balduvian Bears", 1);
|
||||
assertLife(playerB, 20 - 2 - 3);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package org.mage.test.cards.single.mir;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.player.TestPlayer;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class PhyrexianDreadnoughtTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Phyrexian Dreadnought
|
||||
{1}
|
||||
Artifact Creature — Phyrexian Dreadnought
|
||||
|
||||
Trample
|
||||
|
||||
When this creature enters, sacrifice it unless you sacrifice any number of creatures with total power 12 or greater.
|
||||
|
||||
12/12
|
||||
*/
|
||||
private static final String phyrexianDreadnought = "Phyrexian Dreadnought";
|
||||
|
||||
@Test
|
||||
public void testPhyrexianDreadnoughtCanPay() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.HAND, playerA, phyrexianDreadnought);
|
||||
addCard(Zone.BATTLEFIELD, playerA, phyrexianDreadnought + "@sacTarget");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, phyrexianDreadnought);
|
||||
setChoice(playerA, true);
|
||||
setChoice(playerA, "@sacTarget");
|
||||
setChoice(playerA, TestPlayer.CHOICE_SKIP);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, phyrexianDreadnought, 1);
|
||||
assertGraveyardCount(playerA, phyrexianDreadnought, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPhyrexianDreadnoughtCantPay() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.HAND, playerA, phyrexianDreadnought);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, phyrexianDreadnought);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
setChoice(playerA, false);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, phyrexianDreadnought, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package org.mage.test.cards.single.one;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
||||
public class NahirisSacrificeTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Nahiri's Sacrifice
|
||||
{1}{R}
|
||||
Sorcery
|
||||
|
||||
As an additional cost to cast this spell, sacrifice an artifact or creature with mana value X.
|
||||
|
||||
Nahiri’s Sacrifice deals X damage divided as you choose among any number of target creatures.
|
||||
*/
|
||||
private static final String nahirisSacrifice = "Nahiri's Sacrifice";
|
||||
private static final String balduvianBears = "Balduvian Bears";
|
||||
@Test
|
||||
public void testNahirisSacrifice() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.HAND, playerA, nahirisSacrifice);
|
||||
addCard(Zone.BATTLEFIELD, playerA, balduvianBears);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, balduvianBears + "@bearsB");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, nahirisSacrifice, "@bearsB");
|
||||
setChoice(playerA, "X=2");
|
||||
setChoice(playerA, balduvianBears);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerB, balduvianBears, 1);
|
||||
assertGraveyardCount(playerA, nahirisSacrifice, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNahirisSacrificePrevented() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.HAND, playerA, nahirisSacrifice);
|
||||
addCard(Zone.BATTLEFIELD, playerA, balduvianBears);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, balduvianBears + "@bearsB");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Yasharn, Implacable Earth");
|
||||
|
||||
checkPlayableAbility("Can't cast", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast " + nahirisSacrifice, false);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue