Add tests for Gratuitous Violence - confirmed bug

This commit is contained in:
cg5 2016-08-29 19:51:26 +02:00
parent 9126f06b17
commit 2439b99031

View file

@ -0,0 +1,52 @@
package org.mage.test.cards.single;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author cg5
*/
public class GratuitousViolenceTest extends CardTestPlayerBase {
@Test
public void testWorksOnCreatures() {
addCard(Zone.BATTLEFIELD, playerA, "Gratuitous Violence");
addCard(Zone.BATTLEFIELD, playerA, "Elvish Visionary"); // 1/1
attack(1, playerA, "Elvish Visionary");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerB, 18);
}
@Test
public void testIgnoresNonCreatures() {
addCard(Zone.BATTLEFIELD, playerA, "Gratuitous Violence");
addCard(Zone.BATTLEFIELD, playerA, "Honden of Infinite Rage");
addTarget(playerA, playerB);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
// Honden should deal 1 damage at upkeep (since playerA only
// has one Shrine). GV should not double this.
assertLife(playerB, 19);
}
@Test
public void testIgnoresInstants() {
addCard(Zone.BATTLEFIELD, playerA, "Gratuitous Violence");
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
addCard(Zone.HAND, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerB, 17);
}
}