added 3 Dominari cards, benalish marshal, charge, knight of grace, added a new condition and a new ability

This commit is contained in:
igoudt 2018-03-18 00:18:47 +01:00
parent b046428f8c
commit ddf568679f
9 changed files with 365 additions and 28 deletions

View file

@ -0,0 +1,87 @@
package org.mage.test.cards.single.dom;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
public class SimpleDominariaCards extends CardTestPlayerBase {
@Test
public void benalishMarshall(){
addCard(Zone.BATTLEFIELD, playerA, "Benalish Marshal", 1);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
addCard(Zone.BATTLEFIELD, playerB, "Wood Elves", 1);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPowerToughness(playerA, "Benalish Marshal", 3, 3);
assertPowerToughness(playerA, "Grizzly Bears", 3, 3);
assertPowerToughness(playerB, "Wood Elves", 1, 1);
}
@Test
public void testCharge(){
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
addCard(Zone.BATTLEFIELD, playerB, "Wood Elves", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.HAND, playerA, "Charge", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Charge");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPowerToughness(playerA, "Grizzly Bears", 3, 3);
assertPowerToughness(playerB, "Wood Elves", 1, 1);
}
@Test
public void testKnightOfGraceBlackSpell(){
addCard(Zone.BATTLEFIELD, playerA, "Knight of Grace");
addCard(Zone.HAND, playerB, "Terror");
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Knight of Grace");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Knight of Grace", 0);
}
@Test
public void testKnightOfGraceRedSpell(){
addCard(Zone.BATTLEFIELD, playerA, "Knight of Grace");
addCard(Zone.HAND, playerB, "Geistflame");
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Geistflame", "Knight of Grace");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Knight of Grace", 0);
assertDamageReceived(playerA, "Knight of Grace", 1);
assertPowerToughness(playerA, "Knight of Grace", 2, 2);
}
@Test
public void testKnightOfGraceBlackAbility(){
addCard(Zone.BATTLEFIELD, playerA, "Knight of Grace");
addCard(Zone.BATTLEFIELD, playerB, "Royal Assassin");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: ", "Knight of Grace");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Knight of Grace", 0);
}
@Test
public void testKnightOfGraceAnyPlayerControls(){
addCard(Zone.BATTLEFIELD, playerA, "Knight of Grace");
addCard(Zone.BATTLEFIELD, playerB, "Royal Assassin");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPowerToughness(playerA, "Knight of Grace", 3, 2);
}
}

View file

@ -1299,10 +1299,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
}
}
public void assertDamageReceived(Player player, String cardName, int amount) {
public void assertDamageReceived(Player player, String cardName, int expected) {
Permanent p = getPermanent(cardName, player.getId());
if (p != null) {
Assert.assertEquals(p.getDamage(), amount);
Assert.assertEquals("Wrong damage received: ", expected, p.getDamage());
}
}
}