mirror of
https://github.com/correl/mage.git
synced 2025-04-10 17:00:08 -09:00
Tests: fixed BrainMaggotTest;
This commit is contained in:
parent
c1e4fce448
commit
c1804f810c
2 changed files with 23 additions and 9 deletions
Mage.Tests/src/test/java/org/mage/test
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package org.mage.test.cards.triggers.dies;
|
package org.mage.test.cards.triggers.dies;
|
||||||
|
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
|
@ -7,7 +6,6 @@ import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public class BrainMaggotTest extends CardTestPlayerBase {
|
public class BrainMaggotTest extends CardTestPlayerBase {
|
||||||
|
@ -16,7 +14,6 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
||||||
* When Brain Maggot enters the battlefield, target opponent reveals his or
|
* When Brain Maggot enters the battlefield, target opponent reveals his or
|
||||||
* her hand and you choose a nonland card from it. Exile that card until
|
* her hand and you choose a nonland card from it. Exile that card until
|
||||||
* Brain Maggot leaves the battlefield.
|
* Brain Maggot leaves the battlefield.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testCardFromHandWillBeExiled() {
|
public void testCardFromHandWillBeExiled() {
|
||||||
|
@ -26,10 +23,12 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
||||||
addCard(Zone.HAND, playerB, "Bloodflow Connoisseur", 1);
|
addCard(Zone.HAND, playerB, "Bloodflow Connoisseur", 1);
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brain Maggot");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brain Maggot");
|
||||||
addTarget(playerA, "Bloodflow Connoisseur");
|
addTarget(playerA, playerB);
|
||||||
|
setChoice(playerA, "Bloodflow Connoisseur");
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
assertPermanentCount(playerA, "Brain Maggot", 1);
|
assertPermanentCount(playerA, "Brain Maggot", 1);
|
||||||
assertExileCount("Bloodflow Connoisseur", 1);
|
assertExileCount("Bloodflow Connoisseur", 1);
|
||||||
|
@ -45,12 +44,22 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
||||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||||
|
|
||||||
|
// exile
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brain Maggot");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brain Maggot");
|
||||||
addTarget(playerA, "Bloodflow Connoisseur");
|
addTarget(playerA, playerB);
|
||||||
castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Lightning Bolt", "Brain Maggot");
|
setChoice(playerA, "Bloodflow Connoisseur");
|
||||||
|
showExile("exile", 1, PhaseStep.BEGIN_COMBAT, playerB);
|
||||||
|
checkExileCount("blood must be in exile", 1, PhaseStep.BEGIN_COMBAT, playerB, "Bloodflow Connoisseur", 1);
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.DECLARE_ATTACKERS);
|
// return
|
||||||
|
castSpell(1, PhaseStep.END_COMBAT, playerB, "Lightning Bolt", "Brain Maggot");
|
||||||
|
checkPermanentCount("brain must die", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Brain Maggot", 0);
|
||||||
|
checkExileCount("blood must return from exile", 1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Bloodflow Connoisseur", 0);
|
||||||
|
checkHandCardCount("blood must be in hand", 1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Bloodflow Connoisseur", 1);
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
execute();
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
assertGraveyardCount(playerA, "Brain Maggot", 1);
|
assertGraveyardCount(playerA, "Brain Maggot", 1);
|
||||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||||
|
@ -68,11 +77,14 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mesmeric Fiend");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mesmeric Fiend");
|
||||||
addTarget(playerA, "Bloodflow Connoisseur");
|
addTarget(playerA, playerB);
|
||||||
|
setChoice(playerA, "Bloodflow Connoisseur");
|
||||||
|
//
|
||||||
castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Lightning Bolt", "Mesmeric Fiend");
|
castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Lightning Bolt", "Mesmeric Fiend");
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.DECLARE_ATTACKERS);
|
setStopAt(1, PhaseStep.DECLARE_ATTACKERS);
|
||||||
execute();
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
assertGraveyardCount(playerA, "Mesmeric Fiend", 1);
|
assertGraveyardCount(playerA, "Mesmeric Fiend", 1);
|
||||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||||
|
|
|
@ -658,7 +658,9 @@ public class TestPlayer implements Player {
|
||||||
// show exile
|
// show exile
|
||||||
if (params[0].equals(SHOW_COMMAND_EXILE) && params.length == 1) {
|
if (params[0].equals(SHOW_COMMAND_EXILE) && params.length == 1) {
|
||||||
printStart(action.getActionName());
|
printStart(action.getActionName());
|
||||||
printCards(game.getExile().getAllCards(game));
|
printCards(game.getExile().getAllCards(game).stream()
|
||||||
|
.filter(card -> card.isOwnedBy(computerPlayer.getId()))
|
||||||
|
.collect(Collectors.toList()));
|
||||||
printEnd();
|
printEnd();
|
||||||
actions.remove(action);
|
actions.remove(action);
|
||||||
wasProccessed = true;
|
wasProccessed = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue