Skip to content

Commit

Permalink
tests: added more strictly checks for choice commands order, fixed wr…
Browse files Browse the repository at this point in the history
…ong commands in old tests (related to #12044);
  • Loading branch information
JayDi85 committed Jan 16, 2025
1 parent 5d4112c commit c82511f
Show file tree
Hide file tree
Showing 11 changed files with 216 additions and 97 deletions.
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/m/MimicVat.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public MimicVat(UUID ownerId, CardSetInfo setInfo) {
// Imprint - Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with Mimic Vat to its owner's graveyard.
this.addAbility(new MimicVatTriggeredAbility());

// {3}, {tap}: Create a token that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step.
// {3}, {T}: Create a token that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step.
Ability ability = new SimpleActivatedAbility(new MimicVatCreateTokenEffect(), new GenericManaCost(3));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ public void testConspire() {
setChoice(playerA, "Goblin Roughrider^Raging Goblin"); // tap for conspire
setChoice(playerA, false); // don't change target

setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertLife(playerB, 20 - 3 - 3);
assertGraveyardCount(playerA, "Burn Trail", 1);
assertTapped("Goblin Roughrider", true);
assertTapped("Raging Goblin", true);

}

@Test
Expand All @@ -67,6 +67,7 @@ public void testConspireNotUsed() {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burn Trail", playerB);
setChoice(playerA, false);

setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down Expand Up @@ -103,7 +104,6 @@ public void testWortTheRaidmother() {
assertPermanentCount(playerA, "Wort, the Raidmother", 1);
assertGraveyardCount(playerA, "Lightning Bolt", 1);
assertLife(playerB, 20 - 3 - 3);

}

@Test
Expand Down Expand Up @@ -137,7 +137,6 @@ public void testWortTheRaidmotherTwoSpells() {
assertGraveyardCount(playerA, "Lightning Bolt", 1);
assertTapped("Raging Goblin", false);
assertLife(playerB, 20 - 3 - 3 - 2);

}

@Test
Expand All @@ -158,8 +157,10 @@ public void testWortTheRaidmotherWithConspireSpellOnce() {
setChoice(playerA, "Goblin Warrior Token", 2); // tap for conspire
setChoice(playerA, false); // keep targets

setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();

assertPermanentCount(playerA, "Wort, the Raidmother", 1);
assertLife(playerB, 20 - 3 - 3);
assertLife(playerA, 20);
Expand All @@ -181,22 +182,20 @@ public void testWortTheRaidmotherWithConspireSpellTwice() {
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Burn Trail", playerB);
setChoice(playerA, true); // use Conspire from Burn Trail itself
setChoice(playerA, true); // use Conspire gained from Wort, the Raidmother
setChoice(playerA, "When you pay the conspire"); // order triggers

setChoice(playerA, "Goblin Warrior Token", 2); // tap for conspire
setChoice(playerA, false); // keep targets

setChoice(playerA, "Raging Goblin", 2); // tap for conspire
setChoice(playerA, "When you pay the conspire"); // order triggers
setChoice(playerA, false); // keep targets
setChoice(playerA, false); // keep targets


setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();

assertPermanentCount(playerA, "Wort, the Raidmother", 1);
assertLife(playerB, 20 - 3 - 3 - 3);
assertLife(playerA, 20);
assertGraveyardCount(playerA, "Burn Trail", 1);

}

@Test
Expand All @@ -221,8 +220,10 @@ public void testWortTheRaidmotherWithSakashimaOnce() {
setChoice(playerA, "Goblin Warrior Token", 2); // tap for conspire
setChoice(playerA, false); // keep targets

setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();

assertPermanentCount(playerA, "Wort, the Raidmother", 1);
assertPermanentCount(playerA, "Sakashima the Impostor", 1);
assertLife(playerB, 20 - 3 - 3);
Expand All @@ -248,15 +249,16 @@ public void testWortTheRaidmotherWithSakashimaTwice() {
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setChoice(playerA, true); // use Conspire gained from Wort, the Raidmother
setChoice(playerA, true); // use Conspire gained from Sakashima the Imposter
setChoice(playerA, "When you pay the conspire"); // order triggers

setChoice(playerA, "Goblin Warrior Token", 2); // tap for conspire
setChoice(playerA, false); // keep targets
setChoice(playerA, "Goblin Warrior Token", 2); // tap for conspire
setChoice(playerA, "When you pay the conspire"); // order triggers
setChoice(playerA, false); // keep targets
setChoice(playerA, false); // keep targets

setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();

assertPermanentCount(playerA, "Wort, the Raidmother", 1);
assertPermanentCount(playerA, "Sakashima the Impostor", 1);
assertLife(playerB, 20 - 3 - 3 - 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* {3}
* Artifact
* Imprint — Whenever a nontoken creature dies, you may exile that card.
* If you do, return each other card exiled with Mimic Vat to its owner’s graveyard.
* If you do, return each other card exiled with Mimic Vat to its owner’s graveyard.
* {3}, {T}: Create a token that’s a copy of a card exiled with Mimic Vat.
* It gains haste.
* Exile it at the beginning of the next end step.
* It gains haste.
* Exile it at the beginning of the next end step.
*
* @author LevelX2
*/
Expand Down Expand Up @@ -77,17 +77,23 @@ public void TestPhyrexianMetamorph() {

addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);

// prepare copy
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph", true);
setChoice(playerA, true);
setChoice(playerA, "Silvercoat Lion");
setChoice(playerA, true); // pay 2 life
setChoice(playerA, true); // copy on etb
setChoice(playerA, "Silvercoat Lion"); // copy

// sacrifice and exile a copy
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}, Sacrifice a creature");
setChoice(playerA, "Silvercoat Lion");
setChoice(playerA, true);

// create copy of exiled Metamorph
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}, {T}: Create a token that's a copy of a card exiled with ");
setChoice(playerA, true);
setChoice(playerA, "Silvercoat Lion");
setChoice(playerA, true); // copy on etb
setChoice(playerA, "Silvercoat Lion"); // copy

setStrictChooseMode(true);
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down Expand Up @@ -125,6 +131,7 @@ public void TestExileFails() {

activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}, {T}: Create a token that's a copy of a card exiled with ");

setStrictChooseMode(true);
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down
Loading

0 comments on commit c82511f

Please sign in to comment.