mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
Fixed some bugs in test cases and changed check for existing abilities to containsRule() method if ability is no singleton.
This commit is contained in:
parent
4af4619b44
commit
ea6a094aa2
5 changed files with 11 additions and 9 deletions
|
@ -103,7 +103,7 @@ public class LevelUpAbilityTest extends CardTestPlayerBase {
|
|||
Assert.assertEquals("Power different", 9, master.getPower().getValue());
|
||||
Assert.assertEquals("Toughness different", 9, master.getToughness().getValue());
|
||||
Assert.assertTrue(master.getAbilities().contains(LifelinkAbility.getInstance()));
|
||||
Assert.assertTrue(master.getAbilities().contains(new IndestructibleAbility()));
|
||||
Assert.assertTrue(master.getAbilities().containsRule(new IndestructibleAbility()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -127,7 +127,7 @@ public class LevelUpAbilityTest extends CardTestPlayerBase {
|
|||
Assert.assertEquals("Power different", 9, master.getPower().getValue());
|
||||
Assert.assertEquals("Toughness different", 9, master.getToughness().getValue());
|
||||
Assert.assertTrue(master.getAbilities().contains(LifelinkAbility.getInstance()));
|
||||
Assert.assertTrue(master.getAbilities().contains(new IndestructibleAbility()));
|
||||
Assert.assertTrue(master.getAbilities().containsRule(new IndestructibleAbility()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class AlchemistsRefugeTest extends CardTestPlayerBase {
|
|||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
|
||||
addCard(Constants.Zone.HAND, playerA, "Elite Vanguard");
|
||||
|
||||
activateAbility(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{G}{U}, {tap}:");
|
||||
activateAbility(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{G}{U}, {T}:");
|
||||
castSpell(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard");
|
||||
|
||||
setStopAt(2, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
|
@ -65,7 +65,7 @@ public class AlchemistsRefugeTest extends CardTestPlayerBase {
|
|||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
|
||||
addCard(Constants.Zone.HAND, playerA, "Elite Vanguard");
|
||||
|
||||
activateAbility(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{G}{U}, {tap}:");
|
||||
activateAbility(2, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "{G}{U}, {T}:");
|
||||
castSpell(4, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard");
|
||||
|
||||
setStopAt(4, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.mage.test.cards.continuous;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import mage.Constants;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.keyword.IslandwalkAbility;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
|
|
@ -84,13 +84,13 @@ public class PhantasmalImageTest extends CardTestPlayerBase {
|
|||
Assert.assertEquals("Power different", 9, master.getPower().getValue());
|
||||
Assert.assertEquals("Toughness different", 9, master.getToughness().getValue());
|
||||
Assert.assertTrue(master.getAbilities().contains(LifelinkAbility.getInstance()));
|
||||
Assert.assertTrue(master.getAbilities().contains(new IndestructibleAbility()));
|
||||
Assert.assertTrue(master.getAbilities().containsRule(new IndestructibleAbility()));
|
||||
|
||||
// But copied one should not
|
||||
Assert.assertEquals("Power different", 3, masterCopied.getPower().getValue());
|
||||
Assert.assertEquals("Toughness different", 3, masterCopied.getToughness().getValue());
|
||||
Assert.assertFalse(masterCopied.getAbilities().contains(LifelinkAbility.getInstance()));
|
||||
Assert.assertFalse(masterCopied.getAbilities().contains(new IndestructibleAbility()));
|
||||
Assert.assertFalse(masterCopied.getAbilities().containsRule(new IndestructibleAbility()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,7 +103,7 @@ public class PhantasmalImageTest extends CardTestPlayerBase {
|
|||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Illusionary Servant");
|
||||
|
||||
setChoice(playerA, "Illusionary Servant");
|
||||
setChoice(playerA, "Illusionary Servant-M12");
|
||||
setChoice(playerA, "Illusionary Servant-M10");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image");
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image");
|
||||
|
|
|
@ -388,10 +388,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
|
||||
if (flag) {
|
||||
Assert.assertTrue("No such ability=" + ability.toString() + ", player=" + player.getName() +
|
||||
", cardName" + cardName, found.getAbilities().contains(ability));
|
||||
", cardName" + cardName, found.getAbilities().containsRule(ability));
|
||||
} else {
|
||||
Assert.assertFalse("Card shouldn't have such ability=" + ability.toString() + ", player=" + player.getName() +
|
||||
", cardName" + cardName, found.getAbilities().contains(ability));
|
||||
", cardName" + cardName, found.getAbilities().containsRule(ability));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue