tests: added test and todo for Devoted Druid bug (related to #13583)

This commit is contained in:
Oleg Agafonov 2025-04-30 07:45:18 +04:00
parent 4941a0dd8f
commit d0fd0c4023
4 changed files with 103 additions and 4 deletions

View file

@ -35,7 +35,7 @@ public class MeliraSylvokOutcastTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.BEGIN_COMBAT);
// TODO: Needed since Melira's ability isn't been caught by the is playable check
// TODO: improve PutCountersSourceCost, so it can find real playable ability here instead restriction
try {
execute();
Assert.fail("must throw exception on execute");

View file

@ -0,0 +1,94 @@
package org.mage.test.cards.single.shm;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class DevotedDruidTest extends CardTestPlayerBase {
@Test
public void test_PutCounter_Normal() {
// {T}: Add {G}.
// Put a -1/-1 counter on this creature: Untap this creature.
addCard(Zone.BATTLEFIELD, playerA, "Devoted Druid", 1); // 0/2
// prepare
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}");
checkPermanentTapped("after mana tapped", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Devoted Druid", true, 1);
// add counter and untap
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Put a -1/-1");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkPermanentTapped("after untap", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Devoted Druid", false, 1);
setStopAt(1, PhaseStep.END_TURN);
execute();
}
@Test
public void test_PutCounter_CantPay() {
// {T}: Add {G}.
// Put a -1/-1 counter on this creature: Untap this creature.
addCard(Zone.BATTLEFIELD, playerA, "Devoted Druid", 1); // 0/2
//
// Players cant get counters.
// Counters cant be put on artifacts, creatures, enchantments, or lands.
addCard(Zone.BATTLEFIELD, playerA, "Solemnity", 1);
// If you can't put -1/-1 counters on Devoted Druid (due to an effect such as that of Solemnity),
// you can't activate its second ability.
// ...
// (2018-12-07)
//checkPlayableAbility("can't put counters", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Put a -1/-1", false);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Put a -1/-1");
setStopAt(1, PhaseStep.END_TURN);
// TODO: improve PutCountersSourceCost, so it can find real playable ability here instead restriction
try {
setStrictChooseMode(true);
execute();
Assert.fail("must throw exception on execute");
} catch (Throwable e) {
if (!e.getMessage().contains("Put a -1/-1")) {
Assert.fail("Needed error about not being able to use the Devoted Druid's -1/-1 ability, but got:\n" + e.getMessage());
}
}
}
@Test
@Ignore // TODO: must fix, see #13583
public void test_PutCounter_ModifiedToZeroCounters() {
// {T}: Add {G}.
// Put a -1/-1 counter on this creature: Untap this creature.
addCard(Zone.BATTLEFIELD, playerA, "Devoted Druid", 1); // 0/2
//
// If one or more -1/-1 counters would be put on a creature you control, that many -1/-1 counters
// minus one are put on it instead.
addCard(Zone.BATTLEFIELD, playerA, "Vizier of Remedies", 1);
// ...
// If you can put counters on it, but that is modified by an effect (such as that of Vizier of Remedies),
// you can activate the ability even if paying the cost causes no counters to be put on Devoted Druid.
// (2018-12-07)
// prepare
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}");
checkPermanentTapped("after mana tapped", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Devoted Druid", true, 1);
// add counter and untap
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Put a -1/-1");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkPermanentTapped("after untap", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Devoted Druid", false, 1);
setStopAt(1, PhaseStep.END_TURN);
execute();
}
}