mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Test for Issue 374.
This commit is contained in:
parent
5f6c8a46ae
commit
07902b17c7
2 changed files with 41 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
||||||
|
package org.mage.test.cards.triggers;
|
||||||
|
|
||||||
|
import mage.Constants;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ayratn
|
||||||
|
*
|
||||||
|
* Card: Whenever a player taps a land for mana, Manabarbs deals 1 damage to that player.
|
||||||
|
*/
|
||||||
|
public class ManabarbsTest extends CardTestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Issue 374: manabarb enchantment
|
||||||
|
* Games goes into a freeze loop.
|
||||||
|
*
|
||||||
|
* version: 0.8.1
|
||||||
|
*
|
||||||
|
* Couldn't reproduce.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testMultiTriggers() {
|
||||||
|
addCard(Constants.Zone.BATTLEFIELD, playerA, "Manabarbs");
|
||||||
|
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 7);
|
||||||
|
addCard(Constants.Zone.HAND, playerA, "Lightning Elemental");
|
||||||
|
addCard(Constants.Zone.HAND, playerA, "Ball Lightning");
|
||||||
|
|
||||||
|
castSpell(playerA, "Ball Lightning");
|
||||||
|
castSpell(playerA, "Lightning Elemental");
|
||||||
|
|
||||||
|
execute();
|
||||||
|
assertLife(playerA, 13); // burns from Manabarbs
|
||||||
|
assertLife(playerB, 10); // ai should attack with 4/1 + 6/1
|
||||||
|
assertPermanentCount(playerA, "Lightning Elemental", 1);
|
||||||
|
assertPermanentCount(playerA, "Ball Lightning", 0); // sacrificed at EOT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -118,6 +118,9 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP
|
||||||
if (gameZone.equals(Constants.Zone.BATTLEFIELD)) {
|
if (gameZone.equals(Constants.Zone.BATTLEFIELD)) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
Card card = Sets.findCard(cardName, true);
|
Card card = Sets.findCard(cardName, true);
|
||||||
|
if (card == null) {
|
||||||
|
throw new IllegalArgumentException("[TEST] Couldn't find a card: " + cardName);
|
||||||
|
}
|
||||||
PermanentCard p = new PermanentCard(card, null);
|
PermanentCard p = new PermanentCard(card, null);
|
||||||
p.setTapped(tapped);
|
p.setTapped(tapped);
|
||||||
if (player.equals(playerA)) {
|
if (player.equals(playerA)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue