mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Test framework: improves logs in choices errors;
This commit is contained in:
parent
28473c7bd0
commit
e330ed6c7b
3 changed files with 27 additions and 19 deletions
|
@ -22,7 +22,7 @@ public final class GuidingVoice extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
||||
// Learn (You may reveal a Lesson card you own from outside the game and p
|
||||
// Learn (You may reveal a Lesson card you own from outside the game and put it into your hand, or discard a card to draw a card.)
|
||||
this.getSpellAbility().addEffect(new LearnEffect().concatBy("<br>"));
|
||||
}
|
||||
|
||||
|
|
|
@ -94,47 +94,48 @@ public class KaradorGhostChieftainTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
@Test
|
||||
// @Ignore // It's not possible yet to select which ability to use to allow a asThoughtAs effect
|
||||
public void test_castFromGraveyardWithDifferentApprovers() {
|
||||
setStrictChooseMode(true);
|
||||
skipInitShuffling();
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
|
||||
//
|
||||
// {1}{B}: Target attacking Zombie gains indestructible until end of turn.
|
||||
addCard(Zone.LIBRARY, playerA, "Accursed Horde", 1); // Creature Zombie {3}{B}
|
||||
skipInitShuffling();
|
||||
|
||||
addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 5);
|
||||
|
||||
//
|
||||
addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 5); // Creature {1}{W}
|
||||
//
|
||||
// Karador, Ghost Chieftain costs {1} less to cast for each creature card in your graveyard.
|
||||
// During each of your turns, you may cast one creature card from your graveyard.
|
||||
addCard(Zone.HAND, playerA, "Karador, Ghost Chieftain");// {5}{B}{G}{W}
|
||||
|
||||
//
|
||||
// When Gisa and Geralf enters the battlefield, put the top four cards of your library into your graveyard.
|
||||
// During each of your turns, you may cast a Zombie creature card from your graveyard.
|
||||
addCard(Zone.HAND, playerA, "Gisa and Geralf"); // CREATURE {2}{U}{B} (4/4)
|
||||
|
||||
// prepare spels with same AsThough effects and puts creature to graveyard
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Karador, Ghost Chieftain");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gisa and Geralf");
|
||||
|
||||
// you play any creatures due to two approve objects
|
||||
checkPlayableAbility("before", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Silvercoat Lion", true);
|
||||
checkPlayableAbility("before", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Accursed Horde", true);
|
||||
|
||||
// cast zombie creature and approves by Karagar
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Accursed Horde");
|
||||
setChoice(playerA, "During each of your turns, you may cast a Zombie creature card from your graveyard"); // Choose the permitting object
|
||||
setChoice(playerA, "Karador, Ghost Chieftain"); // choose the permitting object
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
|
||||
// you can't cast lion due to approving object (Gisa needs zombie)
|
||||
checkPlayableAbility("after", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Silvercoat Lion", false);
|
||||
checkPlayableAbility("after", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Accursed Horde", false);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Karador, Ghost Chieftain", 1);
|
||||
assertPermanentCount(playerA, "Gisa and Geralf", 1);
|
||||
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
assertPermanentCount(playerA, "Accursed Horde", 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1977,7 +1977,14 @@ public class TestPlayer implements Player {
|
|||
//Assert.fail("Wrong choice");
|
||||
}
|
||||
|
||||
this.chooseStrictModeFailed("choice", game, choice.getMessage());
|
||||
String choicesInfo;
|
||||
if (choice.isKeyChoice()) {
|
||||
choicesInfo = String.join("\n", choice.getKeyChoices().values());
|
||||
} else {
|
||||
choicesInfo = String.join("\n", choice.getChoices());
|
||||
}
|
||||
this.chooseStrictModeFailed("choice", game,
|
||||
"Message: " + choice.getMessage() + "\nPossible choices:\n" + choicesInfo);
|
||||
return computerPlayer.choose(outcome, choice, game);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue