mirror of
https://github.com/correl/mage.git
synced 2025-04-10 09:11:04 -09:00
Test for Issue 374.
This commit is contained in:
parent
5f6c8a46ae
commit
07902b17c7
2 changed files with 41 additions and 0 deletions
Mage.Tests/src/test/java/org/mage/test
|
@ -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)) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
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);
|
||||
p.setTapped(tapped);
|
||||
if (player.equals(playerA)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue