Update test for attacking AI. Sometime reproduces not attacking with Zephyr Sprite.

This commit is contained in:
magenoxx 2011-12-26 13:46:18 +04:00
parent a0866ef602
commit 86bd2d3c40
2 changed files with 39 additions and 34 deletions

View file

@ -0,0 +1,39 @@
package org.mage.test.ai.bugs;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
/**
* Reproduces bug when AI didn't attack with one of the creatures.
*
* @ayratn
*/
public class BugDoesntAttackTest extends CardTestBase {
@Test
public void testAttackWithZephyrSprite() throws Exception {
addCard(Constants.Zone.HAND, playerA, "Zephyr Sprite");
addCard(Constants.Zone.HAND, playerA, "Island");
addCard(Constants.Zone.HAND, playerA, "Rupture Spire");
setLife(playerB, 1);
setStopOnTurn(4);
execute();
assertLife(playerB, 0);
}
@Test
public void testAttackWithGoblinGuide() throws Exception {
addCard(Constants.Zone.HAND, playerA, "Goblin Guide");
addCard(Constants.Zone.HAND, playerA, "Mountain");
playLand(playerA, "Mountain");
castSpell(playerA, "Goblin Guide");
execute();
assertLife(playerB, 18);
}
}

View file

@ -1,34 +0,0 @@
package org.mage.test.ai.bugs;
import mage.Constants;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestBase;
/**
* Reproduces bug when AI didn't attack with one of the creatures.
*
* @ayratn
*/
public class BugDoesntAttackWithZephyrSpriteTest extends CardTestBase {
@Test
public void testVersusInfectCreature() throws Exception {
useRedDefault();
addCard(Constants.Zone.HAND, playerA, "Zephyr Sprite");
addCard(Constants.Zone.HAND, playerA, "Island");
addCard(Constants.Zone.HAND, playerA, "Rupture Spire");
setLife(playerB, 1);
setStopOnTurn(4);
execute();
// life:ComputerB:0
assertLife(playerB, 0);
// turn:1
assertTurn(3);
// result:won
assertResult(playerA, GameResult.WON);
// life:ComputerA:20
assertLife(playerA, 20);
}
}