Test and fix for Issue#44: War Falcon - Attack condition does not work properly. Fixed changing controller for game state effects

This commit is contained in:
magenoxx 2012-08-16 08:54:53 +04:00
parent 335462c8c8
commit f2229f9fd7
4 changed files with 62 additions and 8 deletions

View file

@ -149,4 +149,32 @@ public class ExchangeControlTest extends CardTestPlayerBase {
// this one is still on opponent's side
assertPermanentCount(playerB, "Elite Vanguard", 1);
}
/**
* Tests switching controls will affect restriction effect
*/
@Test
public void testRestrictionEffect() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 5);
addCard(Constants.Zone.HAND, playerA, "Switcheroo");
addCard(Constants.Zone.BATTLEFIELD, playerA, "War Falcon");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Elite Vanguard");
addCard(Constants.Zone.BATTLEFIELD, playerB, "Llanowar Elves");
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Switcheroo", "War Falcon^Llanowar Elves");
attack(2, playerB, "War Falcon");
setStopAt(2, Constants.PhaseStep.END_TURN);
execute();
// check creatures changes their controllers
assertPermanentCount(playerA, "Llanowar Elves", 1);
assertPermanentCount(playerB, "War Falcon", 1);
// War Falcon can't attack
assertLife(playerA, 20);
}
}