mirror of
https://github.com/correl/mage.git
synced 2025-04-05 17:00:10 -09:00
Tests: added support of zero targets in TestPlayer (empty string in addTarget);
Tests: fixed CopySpellTest;
This commit is contained in:
parent
5d6cc6dc72
commit
243ad8cddd
2 changed files with 15 additions and 2 deletions
Mage.Tests/src/test/java/org/mage/test
|
@ -24,9 +24,15 @@ public class CopySpellTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island", 1);
|
||||
|
||||
// start chain from A - return pillar to hand
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chain of Vapor", "Pillarfield Ox");
|
||||
setChoice(playerB, "Yes");
|
||||
addTarget(playerB, "Silvercoat Lion");
|
||||
//setChoice(playerB, "Yes"); // want to sacrifice
|
||||
addTarget(playerB, "Island"); // select a land to sacrifice
|
||||
setChoice(playerB, "Yes"); // want to copy spell
|
||||
setChoice(playerB, "Yes"); // want to change target
|
||||
addTarget(playerB, "Silvercoat Lion"); // new target after copy
|
||||
// stop the chain on 0 land
|
||||
addTarget(playerB, "");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
|
|
@ -1160,6 +1160,13 @@ public class TestPlayer implements Player {
|
|||
abilityControllerId = target.getAbilityController();
|
||||
}
|
||||
|
||||
// do not select
|
||||
if (targets.get(0).equals("")) {
|
||||
Assert.assertEquals("found empty choice, but target is not support 0 choice", 0, target.getMinNumberOfTargets());
|
||||
targets.remove(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// player
|
||||
if (target instanceof TargetPlayer
|
||||
|| target instanceof TargetAnyTarget
|
||||
|
|
Loading…
Add table
Reference in a new issue