mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
[Simulated AI] Test coverage for playing lands.
This commit is contained in:
@@ -14,39 +14,59 @@ public class SpellAbilityPickerTest extends SimulationTestCase {
|
||||
|
||||
addCard("Mountain", p);
|
||||
addCardToZone("Shock", p, ZoneType.Hand);
|
||||
|
||||
|
||||
Player opponent = game.getPlayers().get(0);
|
||||
addCard("Runeclaw Bear", opponent);
|
||||
opponent.setLife(2, null);
|
||||
|
||||
|
||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||
game.getAction().checkStateEffects(true);
|
||||
|
||||
|
||||
SpellAbilityPicker picker = new SpellAbilityPicker(game, p);
|
||||
SpellAbility sa = picker.chooseSpellAbilityToPlay(null);
|
||||
assertNotNull(sa);
|
||||
assertNull(sa.getTargetCard());
|
||||
assertEquals(opponent, sa.getTargets().getFirstTargetedPlayer());
|
||||
}
|
||||
|
||||
|
||||
public void testPickingKillingCreature() {
|
||||
Game game = initAndCreateGame();
|
||||
Player p = game.getPlayers().get(1);
|
||||
|
||||
addCard("Mountain", p);
|
||||
addCardToZone("Shock", p, ZoneType.Hand);
|
||||
|
||||
|
||||
Player opponent = game.getPlayers().get(0);
|
||||
Card bearCard = addCard("Runeclaw Bear", opponent);
|
||||
opponent.setLife(20, null);
|
||||
|
||||
|
||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||
game.getAction().checkStateEffects(true);
|
||||
|
||||
|
||||
SpellAbilityPicker picker = new SpellAbilityPicker(game, p);
|
||||
SpellAbility sa = picker.chooseSpellAbilityToPlay(null);
|
||||
assertNotNull(sa);
|
||||
assertEquals(bearCard, sa.getTargetCard());
|
||||
assertNull(sa.getTargets().getFirstTargetedPlayer());
|
||||
}
|
||||
|
||||
public void testSequenceStartingWithPlayingLand() {
|
||||
Game game = initAndCreateGame();
|
||||
Player p = game.getPlayers().get(1);
|
||||
|
||||
Card mountain = addCardToZone("Mountain", p, ZoneType.Hand);
|
||||
addCardToZone("Shock", p, ZoneType.Hand);
|
||||
|
||||
Player opponent = game.getPlayers().get(0);
|
||||
addCard("Runeclaw Bear", opponent);
|
||||
opponent.setLife(20, null);
|
||||
|
||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||
game.getAction().checkStateEffects(true);
|
||||
|
||||
SpellAbilityPicker picker = new SpellAbilityPicker(game, p);
|
||||
SpellAbility sa = picker.chooseSpellAbilityToPlay(null);
|
||||
assertEquals(game.PLAY_LAND_SURROGATE, sa);
|
||||
assertEquals(mountain, sa.getHostCard());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user