forked from External/mage
Tests for deal damage to creatures.
This commit is contained in:
parent
60b6fe5a79
commit
4cb00a5712
3 changed files with 51 additions and 4 deletions
|
|
@ -11,7 +11,6 @@ public class LightningBoltTest extends CardTestBase {
|
|||
|
||||
@Test
|
||||
public void testDamageOpponent() {
|
||||
System.out.println("TEST: testDamageOpponent");
|
||||
addCard(Constants.Zone.HAND, playerA, "Mountain");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
|
||||
|
||||
|
|
@ -26,7 +25,6 @@ public class LightningBoltTest extends CardTestBase {
|
|||
|
||||
@Test
|
||||
public void testDamageSelf() {
|
||||
System.out.println("TEST: testDamageSelf");
|
||||
addCard(Constants.Zone.HAND, playerA, "Mountain");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
|
||||
|
||||
|
|
@ -40,4 +38,49 @@ public class LightningBoltTest extends CardTestBase {
|
|||
assertLife(playerB, 20);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDamageSmallCreature() {
|
||||
addCard(Constants.Zone.HAND, playerA, "Mountain");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Sejiri Merfolk");
|
||||
|
||||
playLand(playerA, "Mountain");
|
||||
castSpell(playerA, "Lightning Bolt");
|
||||
addFixedTarget(playerA, "Lightning Bolt", "Sejiri Merfolk");
|
||||
|
||||
execute();
|
||||
assertPermanentCount(playerB, "Sejiri Merfolk", 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDamageBigCreature() {
|
||||
addCard(Constants.Zone.HAND, playerA, "Mountain");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm");
|
||||
|
||||
playLand(playerA, "Mountain");
|
||||
castSpell(playerA, "Lightning Bolt");
|
||||
addFixedTarget(playerA, "Lightning Bolt", "Craw Wurm");
|
||||
|
||||
execute();
|
||||
assertPermanentCount(playerB, "Craw Wurm", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDamageBigCreatureTwice() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Craw Wurm");
|
||||
|
||||
castSpell(playerA, "Lightning Bolt");
|
||||
addFixedTarget(playerA, "Lightning Bolt", "Craw Wurm");
|
||||
castSpell(playerA, "Lightning Bolt");
|
||||
addFixedTarget(playerA, "Lightning Bolt", "Craw Wurm");
|
||||
|
||||
execute();
|
||||
assertPermanentCount(playerB, "Craw Wurm", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ public abstract class CardTestBase extends CardTestAPIImpl {
|
|||
private AIType aiTypeA, aiTypeB;
|
||||
|
||||
public CardTestBase() {
|
||||
aiTypeA = CardTestBase.AIType.MAD;
|
||||
aiTypeB = CardTestBase.AIType.MAD;
|
||||
aiTypeA = AIType.MAD;
|
||||
aiTypeB = AIType.MAD;
|
||||
}
|
||||
|
||||
public CardTestBase(AIType aiTypeA, AIType aiTypeB) {
|
||||
|
|
|
|||
|
|
@ -367,6 +367,10 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP
|
|||
player.addAction("cast:"+cardName + ";name=" + target.getName());
|
||||
}
|
||||
|
||||
public void addFixedTarget(Player player, String cardName, String targetName) {
|
||||
player.addAction("cast:"+cardName + ";name=" + targetName);
|
||||
}
|
||||
|
||||
public void useAbility(Player player, String cardName) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue