mirror of
https://github.com/correl/mage.git
synced 2025-04-02 03:18:09 -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;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
|
@ -7,7 +6,6 @@ import org.junit.Test;
|
|||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
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
|
||||
* her hand and you choose a nonland card from it. Exile that card until
|
||||
* Brain Maggot leaves the battlefield.
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testCardFromHandWillBeExiled() {
|
||||
|
@ -26,10 +23,12 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
|||
addCard(Zone.HAND, playerB, "Bloodflow Connoisseur", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brain Maggot");
|
||||
addTarget(playerA, "Bloodflow Connoisseur");
|
||||
addTarget(playerA, playerB);
|
||||
setChoice(playerA, "Bloodflow Connoisseur");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Brain Maggot", 1);
|
||||
assertExileCount("Bloodflow Connoisseur", 1);
|
||||
|
@ -45,12 +44,22 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
|||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
|
||||
// exile
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brain Maggot");
|
||||
addTarget(playerA, "Bloodflow Connoisseur");
|
||||
castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Lightning Bolt", "Brain Maggot");
|
||||
addTarget(playerA, playerB);
|
||||
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();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Brain Maggot", 1);
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
|
@ -68,11 +77,14 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
|
||||
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");
|
||||
|
||||
setStopAt(1, PhaseStep.DECLARE_ATTACKERS);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Mesmeric Fiend", 1);
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
|
|
|
@ -658,7 +658,9 @@ public class TestPlayer implements Player {
|
|||
// show exile
|
||||
if (params[0].equals(SHOW_COMMAND_EXILE) && params.length == 1) {
|
||||
printStart(action.getActionName());
|
||||
printCards(game.getExile().getAllCards(game));
|
||||
printCards(game.getExile().getAllCards(game).stream()
|
||||
.filter(card -> card.isOwnedBy(computerPlayer.getId()))
|
||||
.collect(Collectors.toList()));
|
||||
printEnd();
|
||||
actions.remove(action);
|
||||
wasProccessed = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue