[Mage.Tests] Now all tests work.

This commit is contained in:
magenoxx 2011-12-24 19:33:24 +04:00
parent cdb9cd69ff
commit 8e178478e2
3 changed files with 10 additions and 13 deletions

View file

@ -1,4 +1,4 @@
package org.mage.test.serverside.ai;
package org.mage.test.ai.bugs;
import mage.Constants;
import org.junit.Test;
@ -9,7 +9,7 @@ import org.mage.test.serverside.base.CardTestBase;
*
* @ayratn
*/
public class BugDoesntAttackWithKnightTest extends CardTestBase {
public class BugDoesntAttackWithZephyrSpriteTest extends CardTestBase {
@Test
public void testVersusInfectCreature() throws Exception {
@ -30,6 +30,5 @@ public class BugDoesntAttackWithKnightTest extends CardTestBase {
assertResult(playerA, GameResult.WON);
// life:ComputerA:20
assertLife(playerA, 20);
}
}

View file

@ -1,4 +1,4 @@
package org.mage.test.serverside.ai;
package org.mage.test.ai.bugs;
import junit.framework.Assert;
import mage.Constants;
@ -17,7 +17,6 @@ import org.mage.test.serverside.base.CardTestBase;
public class BugTapsItselfTest extends CardTestBase {
@Test
@Ignore
public void testVersusInfectCreature() throws Exception {
useWhiteDefault();
addCard(Constants.Zone.BATTLEFIELD, playerA, "Blinding Mage");

View file

@ -1,8 +1,5 @@
package org.mage.test.serverside.base.impl;
import java.util.List;
import java.util.UUID;
import mage.Constants;
import mage.abilities.Ability;
import mage.cards.Card;
@ -11,11 +8,13 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
import mage.players.Player;
import mage.sets.Sets;
import org.junit.Assert;
import org.mage.test.serverside.base.CardTestAPI;
import org.mage.test.serverside.base.MageTestBase;
import java.util.List;
import java.util.UUID;
/**
* API for test initialization and asserting the test results.
*
@ -207,17 +206,17 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP
public void assertResult(Player player, GameResult result) throws AssertionError {
if (player.equals(playerA)) {
GameResult actual = CardTestAPI.GameResult.DRAW;
if (currentGame.getWinner().equals("Player ComputerA is the winner")) {
if (currentGame.getWinner().equals("Player PlayerA is the winner")) {
actual = CardTestAPI.GameResult.WON;
} else if (currentGame.getWinner().equals("Player ComputerB is the winner")) {
} else if (currentGame.getWinner().equals("Player PlayerB is the winner")) {
actual = CardTestAPI.GameResult.LOST;
}
Assert.assertEquals("Game results are not equal", result, actual);
} else if (player.equals(playerB)) {
GameResult actual = CardTestAPI.GameResult.DRAW;
if (currentGame.getWinner().equals("Player ComputerB is the winner")) {
if (currentGame.getWinner().equals("Player PlayerB is the winner")) {
actual = CardTestAPI.GameResult.WON;
} else if (currentGame.getWinner().equals("Player ComputerA is the winner")) {
} else if (currentGame.getWinner().equals("Player PlayerA is the winner")) {
actual = CardTestAPI.GameResult.LOST;
}
Assert.assertEquals("Game results are not equal", result, actual);