tests: added verify check for wrong target tags usage, improved work with tagged targets (related to 8b2a81cb42)

This commit is contained in:
Oleg Agafonov 2025-06-01 08:54:24 +04:00
parent 3223d99b2a
commit 71b0613355
4 changed files with 121 additions and 36 deletions

View file

@ -0,0 +1,61 @@
package org.mage.test.cards.single.ltr;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.player.TestPlayer;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class FriendlyRivalryTest extends CardTestPlayerBase {
@Test
public void test_target_both() {
// Target creature you control and up to one other target legendary creature you control each deal damage
// equal to their power to target creature you don't control.
addCard(Zone.HAND, playerA, "Friendly Rivalry"); // {R}{G}
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
//
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears"); // 2/2
addCard(Zone.BATTLEFIELD, playerA, "Aesi, Tyrant of Gyre Strait"); // legendary, 5/5
addCard(Zone.BATTLEFIELD, playerB, "Agonasaur Rex"); // 8/8
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Friendly Rivalry");
addTarget(playerA, "Grizzly Bears");
addTarget(playerA, "Aesi, Tyrant of Gyre Strait");
addTarget(playerA, "Agonasaur Rex");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertDamageReceived(playerB, "Agonasaur Rex", 2 + 5);
}
@Test
public void test_target_single() {
// Target creature you control and up to one other target legendary creature you control each deal damage
// equal to their power to target creature you don't control.
addCard(Zone.HAND, playerA, "Friendly Rivalry"); // {R}{G}
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
//
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears"); // 2/2
addCard(Zone.BATTLEFIELD, playerA, "Aesi, Tyrant of Gyre Strait"); // legendary, 5/5
addCard(Zone.BATTLEFIELD, playerB, "Agonasaur Rex"); // 8/8
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Friendly Rivalry");
addTarget(playerA, "Grizzly Bears");
addTarget(playerA, TestPlayer.TARGET_SKIP); // skip second target due "up to"
addTarget(playerA, "Agonasaur Rex");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertDamageReceived(playerB, "Agonasaur Rex", 2);
}
}