mirror of
https://github.com/correl/mage.git
synced 2025-04-10 09:11:04 -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, "Pillarfield Ox", 1);
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Island", 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");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chain of Vapor", "Pillarfield Ox");
|
||||||
setChoice(playerB, "Yes");
|
//setChoice(playerB, "Yes"); // want to sacrifice
|
||||||
addTarget(playerB, "Silvercoat Lion");
|
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);
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
|
|
@ -1160,6 +1160,13 @@ public class TestPlayer implements Player {
|
||||||
abilityControllerId = target.getAbilityController();
|
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
|
// player
|
||||||
if (target instanceof TargetPlayer
|
if (target instanceof TargetPlayer
|
||||||
|| target instanceof TargetAnyTarget
|
|| target instanceof TargetAnyTarget
|
||||||
|
|
Loading…
Add table
Reference in a new issue