mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 06:22:01 -08:00
Reworking card types in preparation for implementing Grist, the Hunger Tide (#7899)
Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
parent
07e1dff10c
commit
572104b8fc
1159 changed files with 2704 additions and 2203 deletions
|
|
@ -104,8 +104,8 @@ public class TestFrameworkCanPlayAITest extends CardTestPlayerBaseWithAIHelps {
|
|||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
Assert.assertEquals(1, currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE).size());
|
||||
Permanent permanent = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE).get(0);
|
||||
Assert.assertEquals(1, currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame).size());
|
||||
Permanent permanent = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame).get(0);
|
||||
Assert.assertEquals(1, permanent.getAttachments().size());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
|
|
@ -49,8 +50,10 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Gods Willing", "Silent Artisan");
|
||||
setChoice(playerA, "White");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
// because of protection the Hopeful Eidolon should be a creature on the battlefield
|
||||
assertPermanentCount(playerA, "Silent Artisan", 1);
|
||||
|
|
@ -59,6 +62,28 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
assertPowerToughness(playerA, "Hopeful Eidolon", 1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bestowStaysEnchantment() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silent Artisan"); // 3/5
|
||||
addCard(Zone.HAND, playerA, "Hopeful Eidolon");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hopeful Eidolon using bestow", "Silent Artisan");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Silent Artisan", 1);
|
||||
assertPowerToughness(playerA, "Silent Artisan", 4, 6);
|
||||
assertAbility(playerA, "Silent Artisan", LifelinkAbility.getInstance(), true);
|
||||
assertPermanentCount(playerA, "Hopeful Eidolon", 1);
|
||||
assertSubtype("Hopeful Eidolon", SubType.AURA);
|
||||
assertType("Hopeful Eidolon", CardType.ENCHANTMENT, true);
|
||||
assertType("Hopeful Eidolon", CardType.CREATURE, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that cast with bestow does not trigger evolve
|
||||
*/
|
||||
|
|
@ -75,13 +100,15 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Experiment One");
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Boon Satyr using bestow", "Silent Artisan");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
// because Boon Satyr is no creature on the battlefield, evolve may not trigger
|
||||
assertPermanentCount(playerA, "Boon Satyr", 1);
|
||||
Permanent boonSatyr = getPermanent("Boon Satyr", playerA);
|
||||
Assert.assertTrue("Boon Satyr may not be a creature", !boonSatyr.isCreature());
|
||||
Assert.assertTrue("Boon Satyr may not be a creature", !boonSatyr.isCreature(currentGame));
|
||||
assertPermanentCount(playerA, "Silent Artisan", 1);
|
||||
assertPermanentCount(playerA, "Experiment One", 1);
|
||||
assertPowerToughness(playerA, "Experiment One", 1, 1);
|
||||
|
|
@ -105,8 +132,10 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hopeful Eidolon using bestow", "Silvercoat Lion");
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
// because Boon Satyr is no creature on the battlefield, evolve may not trigger
|
||||
assertLife(playerA, 20);
|
||||
|
|
@ -117,8 +146,8 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
assertPowerToughness(playerA, "Hopeful Eidolon", 1, 1);
|
||||
|
||||
Permanent hopefulEidolon = getPermanent("Hopeful Eidolon", playerA);
|
||||
Assert.assertTrue("Hopeful Eidolon has to be a creature but is not", hopefulEidolon.isCreature());
|
||||
Assert.assertTrue("Hopeful Eidolon has to be an enchantment but is not", hopefulEidolon.isEnchantment());
|
||||
Assert.assertTrue("Hopeful Eidolon has to be a creature but is not", hopefulEidolon.isCreature(currentGame));
|
||||
Assert.assertTrue("Hopeful Eidolon has to be an enchantment but is not", hopefulEidolon.isEnchantment(currentGame));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -139,8 +168,10 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Boon Satyr using bestow", "Silent Artisan");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
// because Boon Satyr is no creature on the battlefield, evolve may not trigger
|
||||
assertPermanentCount(playerA, "Silent Artisan", 1);
|
||||
|
|
@ -228,11 +259,16 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
|
||||
|
||||
// B can't cast counter spell due CMC
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hypnotic Siren using bestow", "Silvercoat Lion");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disdainful Stroke", "Hypnotic Siren");
|
||||
checkStackSize("after", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1);
|
||||
checkPlayableAbility("after", 1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cast Disdainful Stroke", false);
|
||||
//castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disdainful Stroke", "Hypnotic Siren");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
//
|
||||
assertHandCount(playerA, "Hypnotic Siren", 0);
|
||||
|
|
@ -266,8 +302,11 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mogis's Warhound using bestow", "Silvercoat Lion");
|
||||
castSpell(1, PhaseStep.END_TURN, playerB, "Chandra's Outrage", "Silvercoat Lion");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 18); // -2 from Chandra's Outrage
|
||||
assertLife(playerB, 18); // -2 from attack of Mogis's Warhound
|
||||
|
|
@ -316,12 +355,17 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Nighthowler using bestow", "Alesha, Who Smiles at Death");
|
||||
|
||||
// attacks by Alesha and return card on trigger
|
||||
attack(2, playerB, "Alesha, Who Smiles at Death");
|
||||
setChoice(playerB, "Yes"); // use trigger
|
||||
addTarget(playerB, "Pillarfield Ox"); // target card to return
|
||||
|
||||
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Chandra's Outrage", "Alesha, Who Smiles at Death");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerB, 18); // -2 from Chandra's Outrage
|
||||
assertLife(playerA, 16); // -3 from attack Alesha with bestowed Nighthowler
|
||||
|
|
@ -332,7 +376,7 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
assertPowerToughness(playerB, "Nighthowler", 2, 2);
|
||||
Permanent nighthowler = getPermanent("Nighthowler", playerB);
|
||||
|
||||
Assert.assertEquals("Nighthowler has to be a creature", true, nighthowler.isCreature());
|
||||
Assert.assertEquals("Nighthowler has to be a creature", true, nighthowler.isCreature(currentGame));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -346,8 +390,11 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerA, "Sightless Brawler");
|
||||
|
||||
attack(1, playerA, "Sightless Brawler");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerB, 20);
|
||||
assertTapped("Sightless Brawler", false);
|
||||
|
|
@ -366,8 +413,11 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
|
||||
attack(1, playerA, "Sightless Brawler");
|
||||
attack(1, playerA, "Elite Vanguard");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerB, 15);
|
||||
assertTapped("Sightless Brawler", true);
|
||||
|
|
@ -386,8 +436,11 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sightless Brawler using bestow", "Elite Vanguard");
|
||||
attack(1, playerA, "Elite Vanguard");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertHandCount(playerA, "Sightless Brawler", 0);
|
||||
assertLife(playerB, 20);
|
||||
|
|
@ -410,8 +463,11 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sightless Brawler using bestow", "Elite Vanguard");
|
||||
attack(1, playerA, "Elite Vanguard");
|
||||
attack(1, playerA, "Memnite");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertHandCount(playerA, "Sightless Brawler", 0);
|
||||
assertLife(playerB, 14);
|
||||
|
|
@ -445,8 +501,11 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nighthowler using bestow", "Silvercoat Lion");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Song of the Dryads", "Silvercoat Lion");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerB, "Song of the Dryads", 1);
|
||||
|
||||
|
|
@ -476,8 +535,10 @@ public class BestowTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nylea's Emissary using bestow", "Silvercoat Lion");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Nylea's Emissary", 1);
|
||||
assertPowerToughness(playerA, "Silvercoat Lion", 5, 5);
|
||||
|
|
|
|||
|
|
@ -181,8 +181,8 @@ public class TransformTest extends CardTestPlayerBase {
|
|||
assertGraveyardCount(playerA, "Startled Awake", 0);
|
||||
assertPermanentCount(playerA, "Persistent Nightmare", 1); // Night-side card of Startled Awake
|
||||
Permanent nightmare = getPermanent("Persistent Nightmare", playerA);
|
||||
Assert.assertTrue("Has to have creature card type", nightmare.isCreature());
|
||||
Assert.assertFalse("Has not to have sorcery card type", nightmare.isSorcery());
|
||||
Assert.assertTrue("Has to have creature card type", nightmare.isCreature(currentGame));
|
||||
Assert.assertFalse("Has not to have sorcery card type", nightmare.isSorcery(currentGame));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
if (permanent.hasSubtype(SubType.SWAMP, currentGame)) {
|
||||
swampTypes++;
|
||||
}
|
||||
if (permanent.isCreature()) {
|
||||
if (permanent.isCreature(currentGame)) {
|
||||
creatures++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,36 +47,36 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
|
||||
|
||||
for (Card card : playerA.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertFalse(card.getName() + " should not have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
|
||||
}
|
||||
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
|
||||
}
|
||||
|
|
@ -122,21 +122,21 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
|
||||
|
||||
for (Card card : playerA.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
|
|
@ -177,39 +177,39 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
|
||||
|
||||
for (Card card : playerA.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
|
||||
}
|
||||
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
|
|
@ -277,21 +277,21 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
Assert.assertFalse(wurm.hasSubtype(SubType.ORC, currentGame));
|
||||
|
||||
for (Card card : playerA.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
|
|
@ -372,36 +372,36 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
|
||||
|
||||
for (Card card : playerA.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
|
||||
}
|
||||
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
|
|
@ -438,36 +438,36 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
|
||||
|
||||
for (Card card : playerA.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getLibrary().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : playerA.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerB.getHand().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
|
||||
}
|
||||
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.isCreature(currentGame)) {
|
||||
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class BattlefieldTriggeredAbilitiesTest extends CardTestPlayerBase {
|
|||
int playerACount = 0;
|
||||
int playerBCount = 0;
|
||||
for (Permanent p : currentGame.getBattlefield().getAllActivePermanents()) {
|
||||
if (p.isLand()) {
|
||||
if (p.isLand(currentGame)) {
|
||||
if (p.getControllerId().equals(playerB.getId())) {
|
||||
playerBCount++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class FelhideSpiritbinderTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
||||
Permanent lion = getPermanent("Silvercoat Lion", playerB);
|
||||
assertAbility(playerB, "Silvercoat Lion", HasteAbility.getInstance(), true);
|
||||
Assert.assertEquals("token has to have card type enchantment", true, lion.getCardType().contains(CardType.ENCHANTMENT));
|
||||
Assert.assertEquals("token has to have card type enchantment", true, lion.getCardType(currentGame).contains(CardType.ENCHANTMENT));
|
||||
|
||||
assertLife(playerA, 17);
|
||||
assertLife(playerB, 20);
|
||||
|
|
@ -93,7 +93,7 @@ public class FelhideSpiritbinderTest extends CardTestPlayerBase {
|
|||
assertAbility(playerB, "Elephant", HasteAbility.getInstance(), true);
|
||||
|
||||
Permanent copiedTokenElephant = getPermanent("Elephant", playerB);
|
||||
Assert.assertEquals("Elephant has Enchantment card type", true, copiedTokenElephant.getCardType().contains(CardType.ENCHANTMENT));
|
||||
Assert.assertEquals("Elephant has Enchantment card type", true, copiedTokenElephant.getCardType(currentGame).contains(CardType.ENCHANTMENT));
|
||||
|
||||
assertLife(playerA, 17);
|
||||
assertLife(playerB, 20);
|
||||
|
|
|
|||
|
|
@ -629,15 +629,15 @@ public class PhantasmalImageTest extends CardTestPlayerBase {
|
|||
assertAllCommandsUsed();
|
||||
|
||||
Permanent staffA = getPermanent("Chimeric Staff", playerA);
|
||||
assertTrue("Phantasmal Image should be an artifact", staffA.isArtifact());
|
||||
assertTrue("Phantasmal Image should not be a creature", !staffA.isCreature());
|
||||
assertTrue("Phantasmal Image should be an artifact", staffA.isArtifact(currentGame));
|
||||
assertTrue("Phantasmal Image should not be a creature", !staffA.isCreature(currentGame));
|
||||
assertTrue("Phantasmal Image should not be an Illusion", !staffA.hasSubtype(SubType.ILLUSION, currentGame));
|
||||
assertTrue("Phantasmal Image should not be a Construct", !staffA.hasSubtype(SubType.CONSTRUCT, currentGame));
|
||||
assertTrue("Phantasmal Image should have the sacrifice trigger", staffA.getAbilities(currentGame).containsClass(BecomesTargetTriggeredAbility.class));
|
||||
|
||||
Permanent staffB = getPermanent("Chimeric Staff", playerB);
|
||||
assertTrue("Chimeric Staff should be an artifact", staffB.isArtifact());
|
||||
assertTrue("Chimeric Staff should be a creature", staffB.isCreature());
|
||||
assertTrue("Chimeric Staff should be an artifact", staffB.isArtifact(currentGame));
|
||||
assertTrue("Chimeric Staff should be a creature", staffB.isCreature(currentGame));
|
||||
assertTrue("Chimeric Staff should be a Construct", staffB.hasSubtype(SubType.CONSTRUCT, currentGame));
|
||||
}
|
||||
|
||||
|
|
@ -659,18 +659,18 @@ public class PhantasmalImageTest extends CardTestPlayerBase {
|
|||
assertAllCommandsUsed();
|
||||
|
||||
Permanent cloakA = getPermanent("Cloak and Dagger", playerA);
|
||||
assertTrue("Phantasmal Image should be an artifact", cloakA.isArtifact());
|
||||
assertTrue("Phantasmal Image should be tribal", cloakA.isTribal());
|
||||
assertTrue("Phantasmal Image should not be a creature", !cloakA.isCreature());
|
||||
assertTrue("Phantasmal Image should be an artifact", cloakA.isArtifact(currentGame));
|
||||
assertTrue("Phantasmal Image should be tribal", cloakA.isTribal(currentGame));
|
||||
assertTrue("Phantasmal Image should not be a creature", !cloakA.isCreature(currentGame));
|
||||
assertTrue("Phantasmal Image should be a Rogue", cloakA.hasSubtype(SubType.ROGUE, currentGame));
|
||||
assertTrue("Phantasmal Image should be an Illusion", cloakA.hasSubtype(SubType.ILLUSION, currentGame));
|
||||
assertTrue("Phantasmal Image should be an Equipment", cloakA.hasSubtype(SubType.EQUIPMENT, currentGame));
|
||||
assertTrue("Phantasmal Image should have the sacrifice trigger", cloakA.getAbilities(currentGame).containsClass(BecomesTargetTriggeredAbility.class));
|
||||
|
||||
Permanent cloakB = getPermanent("Cloak and Dagger", playerB);
|
||||
assertTrue("Cloak and Dagger should be an artifact", cloakB.isArtifact());
|
||||
assertTrue("Cloak and Dagger should be a creature", cloakB.isCreature());
|
||||
assertTrue("Cloak and Dagger should be tribal", cloakB.isTribal());
|
||||
assertTrue("Cloak and Dagger should be an artifact", cloakB.isArtifact(currentGame));
|
||||
assertTrue("Cloak and Dagger should be a creature", cloakB.isCreature(currentGame));
|
||||
assertTrue("Cloak and Dagger should be tribal", cloakB.isTribal(currentGame));
|
||||
assertTrue("Cloak and Dagger should be a Rogue", cloakB.hasSubtype(SubType.ROGUE, currentGame));
|
||||
assertTrue("Cloak and Dagger should be an Equipment", cloakB.hasSubtype(SubType.EQUIPMENT, currentGame));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class ProgenitorMimicTest extends CardTestPlayerBase {
|
|||
int nonTokens = 0;
|
||||
for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) {
|
||||
if (permanent.getControllerId().equals(playerB.getId())) {
|
||||
if (permanent.isCreature()) {
|
||||
if (permanent.isCreature(currentGame)) {
|
||||
if (permanent instanceof PermanentToken) {
|
||||
tokens++;
|
||||
} else {
|
||||
|
|
@ -121,7 +121,7 @@ public class ProgenitorMimicTest extends CardTestPlayerBase {
|
|||
int nonTokens = 0;
|
||||
for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) {
|
||||
if (permanent.getControllerId().equals(playerB.getId())) {
|
||||
if (permanent.isCreature()) {
|
||||
if (permanent.isCreature(currentGame)) {
|
||||
if (permanent instanceof PermanentToken) {
|
||||
tokens++;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -256,8 +256,8 @@ public class ModalDoubleFacesCardsTest extends CardTestPlayerBase {
|
|||
|
||||
// stats in hand - normal
|
||||
Card card = getHandCards(playerA).stream().filter(c -> CardUtil.haveSameNames(c, "Akoum Warrior", currentGame)).findFirst().get();
|
||||
Assert.assertFalse("must be non land", card.isLand());
|
||||
Assert.assertTrue("must be creature", card.isCreature());
|
||||
Assert.assertFalse("must be non land", card.isLand(currentGame));
|
||||
Assert.assertTrue("must be creature", card.isCreature(currentGame));
|
||||
Assert.assertTrue("must be minotaur", card.hasSubtype(SubType.MINOTAUR, currentGame));
|
||||
Assert.assertEquals("power", 4, card.getPower().getValue());
|
||||
Assert.assertEquals("toughness", 5, card.getToughness().getValue());
|
||||
|
|
@ -265,7 +265,7 @@ public class ModalDoubleFacesCardsTest extends CardTestPlayerBase {
|
|||
// stats in hand - mdf
|
||||
card = getHandCards(playerA).stream().filter(c -> CardUtil.haveSameNames(c, "Halvar, God of Battle", currentGame)).findFirst().get();
|
||||
Assert.assertTrue("must be legendary", card.isLegendary());
|
||||
Assert.assertTrue("must be creature", card.isCreature());
|
||||
Assert.assertTrue("must be creature", card.isCreature(currentGame));
|
||||
Assert.assertTrue("must be god", card.hasSubtype(SubType.GOD, currentGame));
|
||||
|
||||
// stats in hand - mdf - color identity must be from both sides
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class DustOfMomentsTest extends CardTestPlayerBase {
|
|||
execute();
|
||||
|
||||
// Chronozoa should have duplicated
|
||||
final List<Permanent> activeCreatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE);
|
||||
final List<Permanent> activeCreatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame);
|
||||
Assert.assertEquals(2, activeCreatures.size());
|
||||
|
||||
for (final Permanent creature : activeCreatures) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
package org.mage.test.cards.single.mh2;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class GristTheHungerTideTest extends CardTestPlayerBase {
|
||||
|
||||
private static final String grist = "Grist, the Hunger Tide";
|
||||
private static final String imp = "Putrid Imp";
|
||||
private static final String leyline = "Leyline of the Void";
|
||||
private static final String bounty = "Primeval Bounty";
|
||||
|
||||
@Test
|
||||
public void testGristInHandBattlefieldGraveLibrary() {
|
||||
addCard(Zone.HAND, playerA, grist);
|
||||
addCard(Zone.BATTLEFIELD, playerA, grist);
|
||||
addCard(Zone.GRAVEYARD, playerA, grist);
|
||||
addCard(Zone.LIBRARY, playerA, grist);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
for (Card card : currentGame.getCards()) {
|
||||
if (!card.getName().equals(grist)) {
|
||||
continue;
|
||||
}
|
||||
Zone zone = currentGame.getState().getZone(card.getId());
|
||||
if (zone == Zone.BATTLEFIELD) {
|
||||
Assert.assertFalse("Not a creature on the battlefield", card.isCreature(currentGame));
|
||||
} else {
|
||||
Assert.assertTrue("Should be a creature when zone is " + zone, card.isCreature(currentGame));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGristInExile() {
|
||||
addCard(Zone.HAND, playerA, grist);
|
||||
addCard(Zone.BATTLEFIELD, playerA, imp);
|
||||
addCard(Zone.BATTLEFIELD, playerB, leyline);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Discard");
|
||||
setChoice(playerA, grist);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
for (Card card : currentGame.getCards()) {
|
||||
if (!card.getName().equals(grist)) {
|
||||
continue;
|
||||
}
|
||||
Assert.assertEquals("", Zone.EXILED, currentGame.getState().getZone(card.getId()));
|
||||
Assert.assertTrue("Should be a creature in exile", card.isCreature(currentGame));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGristFromStackToBattlefield() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, bounty);
|
||||
addCard(Zone.HAND, playerA, grist);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, grist);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
// Grist is a creature spell when cast and triggers bounty
|
||||
assertPermanentCount(playerA, "Beast", 1);
|
||||
// But not a creature on the battlefield
|
||||
assertPermanentCount(playerA, grist, 1);
|
||||
assertType(grist, CardType.CREATURE, false);
|
||||
}
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ public class ChronozoaTest extends CardTestPlayerBase {
|
|||
// The original Chronozoa card should be in graveyard
|
||||
assertGraveyardCount(playerA, 1);
|
||||
|
||||
final List<Permanent> creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE);
|
||||
final List<Permanent> creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame);
|
||||
Assert.assertEquals(2, creatures.size());
|
||||
|
||||
for (final Permanent creature : creatures) {
|
||||
|
|
@ -94,7 +94,7 @@ public class ChronozoaTest extends CardTestPlayerBase {
|
|||
assertGraveyardCount(playerB, 1);
|
||||
|
||||
// Chronozoa shouldn't duplicate
|
||||
final List<Permanent> creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE);
|
||||
final List<Permanent> creatures = currentGame.getBattlefield().getAllActivePermanents(CardType.CREATURE, currentGame);
|
||||
Assert.assertTrue(creatures.isEmpty());
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class HeliodGodOfTheSun extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Hold the Gates", 1);
|
||||
|
||||
Permanent heliodGodOfTheSun = getPermanent("Heliod, God of the Sun", playerA);
|
||||
Assert.assertTrue(heliodGodOfTheSun.isCreature());
|
||||
Assert.assertTrue(heliodGodOfTheSun.isCreature(currentGame));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(), 1);
|
||||
|
||||
Permanent purphorosGodOfTheForge = getPermanent("Purphoros, God of the Forge", playerA);
|
||||
Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.getCardType().contains(CardType.CREATURE));
|
||||
Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.isCreature(currentGame));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -86,7 +86,7 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase {
|
|||
assertLife(playerB, 18); // 2 damage from Purphoros for the morphed Phoenix
|
||||
|
||||
Permanent purphorosGodOfTheForge = getPermanent("Purphoros, God of the Forge", playerA);
|
||||
Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.getCardType().contains(CardType.CREATURE));
|
||||
Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.isCreature(currentGame));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -107,6 +107,6 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase {
|
|||
|
||||
assertLife(playerB, 18);
|
||||
Permanent purphorosGodOfTheForge = getPermanent("Purphoros, God of the Forge", playerA);
|
||||
Assert.assertTrue("Purphoros should be a creature now but is not", purphorosGodOfTheForge.getCardType().contains(CardType.CREATURE));
|
||||
Assert.assertTrue("Purphoros should be a creature now but is not", purphorosGodOfTheForge.isCreature(currentGame));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ public class CastCommanderTest extends CardTestCommanderDuelBase {
|
|||
assertPermanentCount(playerA, "Kestia, the Cultivator", 1);
|
||||
|
||||
Permanent kestia = getPermanent("Kestia, the Cultivator", playerA);
|
||||
Assert.assertNotEquals("Kestia may not be an creature", true, kestia.isCreature());
|
||||
Assert.assertEquals("Kestia has to be an enchantment", true, kestia.isEnchantment());
|
||||
Assert.assertNotEquals("Kestia may not be an creature", true, kestia.isCreature(currentGame));
|
||||
Assert.assertEquals("Kestia has to be an enchantment", true, kestia.isEnchantment(currentGame));
|
||||
|
||||
assertPowerToughness(playerA, "Silvercoat Lion", 6, 6);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1161,7 +1161,7 @@ public class TestPlayer implements Player {
|
|||
+ c.getIdName()
|
||||
+ (c.isCopy() ? " [copy of " + c.getCopyFrom().getId().toString().substring(0, 3) + "]" : "")
|
||||
+ " - " + c.getPower().getValue() + "/" + c.getToughness().getValue()
|
||||
+ (c.isPlaneswalker() ? " - L" + c.getCounters(game).getCount(CounterType.LOYALTY) : "")
|
||||
+ (c.isPlaneswalker(game) ? " - L" + c.getCounters(game).getCount(CounterType.LOYALTY) : "")
|
||||
+ ", " + (c.isTapped() ? "Tapped" : "Untapped")
|
||||
+ getPrintableAliases(", [", c.getId(), "]")
|
||||
+ (c.getAttachedTo() == null ? "" : ", attached to " + game.getPermanent(c.getAttachedTo()).getIdName())))
|
||||
|
|
@ -1479,7 +1479,7 @@ public class TestPlayer implements Player {
|
|||
Permanent perm = findPermanentWithAssert(action, game, player, permanentName);
|
||||
|
||||
boolean found = false;
|
||||
for (CardType ct : perm.getCardType()) {
|
||||
for (CardType ct : perm.getCardType(game)) {
|
||||
if (ct.equals(type)) {
|
||||
found = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1114,7 +1114,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found);
|
||||
|
||||
Assert.assertTrue("(Battlefield) card type " + (mustHave ? "not " : "")
|
||||
+ "found (" + cardName + ':' + type + ')', (found.getCardType().contains(type) == mustHave));
|
||||
+ "found (" + cardName + ':' + type + ')', (found.getCardType(currentGame).contains(type) == mustHave));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1128,7 +1128,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
public void assertType(String cardName, CardType type, SubType subType) throws AssertionError {
|
||||
//Assert.assertNotEquals("", cardName);
|
||||
Permanent found = getPermanent(cardName);
|
||||
Assert.assertTrue("(Battlefield) card type not found (" + cardName + ':' + type + ')', found.getCardType().contains(type));
|
||||
Assert.assertTrue("(Battlefield) card type not found (" + cardName + ':' + type + ')', found.getCardType(currentGame).contains(type));
|
||||
if (subType != null) {
|
||||
Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ':' + subType.getDescription() + ')', found.hasSubtype(subType, currentGame));
|
||||
}
|
||||
|
|
@ -1143,7 +1143,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
public void assertNotType(String cardName, CardType type) throws AssertionError {
|
||||
//Assert.assertNotEquals("", cardName);
|
||||
Permanent found = getPermanent(cardName);
|
||||
Assert.assertFalse("(Battlefield) card type found (" + cardName + ':' + type + ')', found.getCardType().contains(type));
|
||||
Assert.assertFalse("(Battlefield) card type found (" + cardName + ':' + type + ')', found.getCardType(currentGame).contains(type));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1201,9 +1201,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
}
|
||||
|
||||
if (mustHave) {
|
||||
Assert.assertEquals("must contain colors [" + searchColors.toString() + "] but found only [" + cardColor.toString() + "]", 0, colorsDontHave.size());
|
||||
Assert.assertEquals("must contain colors [" + searchColors + "] but found only [" + cardColor.toString() + "]", 0, colorsDontHave.size());
|
||||
} else {
|
||||
Assert.assertEquals("must not contain colors [" + searchColors.toString() + "] but found [" + cardColor.toString() + "]", 0, colorsHave.size());
|
||||
Assert.assertEquals("must not contain colors [" + searchColors + "] but found [" + cardColor.toString() + "]", 0, colorsHave.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1358,13 +1358,13 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
* Assert card subtype in exile.
|
||||
*
|
||||
* @param cardName Name of the card.
|
||||
* @param subType Expected subtype.
|
||||
* @param subType Expected subtype.
|
||||
*/
|
||||
public void assertExiledCardSubtype(String cardName, SubType subType) throws AssertionError {
|
||||
boolean found = false;
|
||||
for (ExileZone exile : currentGame.getExile().getExileZones()) {
|
||||
for (Card card : exile.getCards(currentGame)) {
|
||||
if(CardUtil.haveSameNames(card.getName(), cardName, true) && card.hasSubtype(subType, currentGame)){
|
||||
if (CardUtil.haveSameNames(card.getName(), cardName, true) && card.hasSubtype(subType, currentGame)) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1929,7 +1929,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
|
||||
/**
|
||||
* Setup amount choices.
|
||||
*
|
||||
* <p>
|
||||
* Multi amount choices uses WUBRG order (so use 1,2,3,4,5 values list)
|
||||
*
|
||||
* @param player
|
||||
|
|
@ -2096,22 +2096,22 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
}
|
||||
|
||||
|
||||
public void assertWonTheGame(Player player){
|
||||
public void assertWonTheGame(Player player) {
|
||||
|
||||
Assert.assertTrue(player.getName() + " has not won the game.", player.hasWon());
|
||||
}
|
||||
|
||||
public void assertHasNotWonTheGame(Player player){
|
||||
public void assertHasNotWonTheGame(Player player) {
|
||||
|
||||
Assert.assertFalse(player.getName() + " has won the game.", player.hasWon());
|
||||
}
|
||||
|
||||
public void assertLostTheGame(Player player){
|
||||
public void assertLostTheGame(Player player) {
|
||||
|
||||
Assert.assertTrue(player.getName() + " has not lost the game.", player.hasLost());
|
||||
}
|
||||
|
||||
public void assertHasNotLostTheGame(Player player){
|
||||
public void assertHasNotLostTheGame(Player player) {
|
||||
|
||||
Assert.assertFalse(player.getName() + " has lost the game.", player.hasLost());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,131 @@
|
|||
package org.mage.test.serverside.deck;
|
||||
|
||||
import mage.deck.Commander;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.MageTestBase;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class CompanionTest extends MageTestBase {
|
||||
|
||||
@Test
|
||||
public void testGyrudaTrue() {
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Island", 96);
|
||||
deckTester.addMaindeck("Fact or Fiction", 1);
|
||||
deckTester.addMaindeck("Counterspell", 1);
|
||||
deckTester.addMaindeck("Pact of Negation", 1);
|
||||
|
||||
deckTester.addSideboard("Ramirez DePietro", 1);
|
||||
deckTester.addSideboard("Gyruda, Doom of Depths", 1);
|
||||
|
||||
deckTester.validate("Deck must have all even mana value with Gyruda as a companion");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGyrudaFalseMaindeck() {
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Island", 96);
|
||||
deckTester.addMaindeck("Fact or Fiction", 1);
|
||||
deckTester.addMaindeck("Counterspell", 1);
|
||||
deckTester.addMaindeck("Merfolk of the Pearl Trident", 1);
|
||||
|
||||
deckTester.addSideboard("Ramirez DePietro", 1);
|
||||
deckTester.addSideboard("Gyruda, Doom of Depths", 1);
|
||||
|
||||
deckTester.validate("Maindeck must have all even mana value with Gyruda as a companion", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGyrudaFalseCommander() {
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Island", 96);
|
||||
deckTester.addMaindeck("Fact or Fiction", 1);
|
||||
deckTester.addMaindeck("Counterspell", 1);
|
||||
deckTester.addMaindeck("Pact of Negation", 1);
|
||||
|
||||
deckTester.addSideboard("Sivitri Scarzam", 1);
|
||||
deckTester.addSideboard("Gyruda, Doom of Depths", 1);
|
||||
|
||||
deckTester.validate("Commander must have even mana value with Gyruda as a companion", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKaheeraFalseMaindeck() {
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Forest", 98);
|
||||
deckTester.addMaindeck("Cylian Elf", 1);
|
||||
|
||||
deckTester.addSideboard("Morophon, the Boundless", 1);
|
||||
deckTester.addSideboard("Kaheera, the Orphanguard", 1);
|
||||
|
||||
deckTester.validate("Maindeck must have all legal creature types with Kaheera as a companion", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKaheeraFalseCommander() {
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Forest", 98);
|
||||
deckTester.addMaindeck("Silvercoat Lion", 1);
|
||||
|
||||
deckTester.addSideboard("Jasmine Boreal", 1);
|
||||
deckTester.addSideboard("Kaheera, the Orphanguard", 1);
|
||||
|
||||
deckTester.validate("Commander must be valid with Kaheera as a companion", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKaheeraChangeling() {
|
||||
// Changelings can be in a deck Kaheera as companion as their first abilities apply during deck construction.
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Forest", 98);
|
||||
deckTester.addMaindeck("Woodland Changeling", 1);
|
||||
|
||||
deckTester.addSideboard("Morophon, the Boundless", 1);
|
||||
deckTester.addSideboard("Kaheera, the Orphanguard", 1);
|
||||
|
||||
deckTester.validate("Changelings are legal with Kaheera as a companion");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGristKaheera() {
|
||||
// Grist, the Hunger Tide can't be in a deck with Kaheera as companion as its first ability applies during deck construction.
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Forest", 98);
|
||||
deckTester.addMaindeck("Grist, the Hunger Tide", 1);
|
||||
|
||||
deckTester.addSideboard("Doran, the Siege Tower", 1);
|
||||
deckTester.addSideboard("Kaheera, the Orphanguard", 1);
|
||||
|
||||
deckTester.validate("Grist is not legal with Kaheera as a companion", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGristUmoriCreature() {
|
||||
// Grist, the Hunger Tide can be in a creature deck with Umori as companion as its first ability applies during deck construction.
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Forest", 97);
|
||||
deckTester.addMaindeck("Grizzly Bears", 1);
|
||||
deckTester.addMaindeck("Grist, the Hunger Tide", 1);
|
||||
|
||||
deckTester.addSideboard("Nath of the Gilt-Leaf", 1);
|
||||
deckTester.addSideboard("Umori, the Collector", 1);
|
||||
|
||||
deckTester.validate("Grist is legal as a creature with Umori as a companion");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGristUmoriPlaneswalker() {
|
||||
// Grist, the Hunger Tide can be in a planeswalker deck with Umori as companion as it's still a planeswalker
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Forest", 97);
|
||||
deckTester.addMaindeck("Garruk Wildspeaker", 1);
|
||||
deckTester.addMaindeck("Grist, the Hunger Tide", 1);
|
||||
|
||||
deckTester.addSideboard("Lord Windgrace", 1);
|
||||
deckTester.addSideboard("Umori, the Collector", 1);
|
||||
|
||||
deckTester.validate("Grist is legal as a planeswalker with Umori as a companion");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package org.mage.test.serverside.deck;
|
||||
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.decks.DeckValidator;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class DeckValidationUtil {
|
||||
|
||||
static class CardNameAmount {
|
||||
|
||||
String name;
|
||||
String setCode;
|
||||
String cardNumber;
|
||||
int number;
|
||||
|
||||
CardNameAmount(String setCode, int cardNumber, int number) {
|
||||
this.name = "";
|
||||
this.setCode = setCode;
|
||||
this.cardNumber = String.valueOf(cardNumber);
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
CardNameAmount(String name, int number) {
|
||||
this.name = name;
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
String getSetCode() {
|
||||
return setCode;
|
||||
}
|
||||
|
||||
String getCardNumber() {
|
||||
return cardNumber;
|
||||
}
|
||||
}
|
||||
|
||||
private DeckValidationUtil() {
|
||||
}
|
||||
|
||||
public static boolean testDeckValid(DeckValidator validator, List<CardNameAmount> cards) {
|
||||
return testDeckValid(validator, cards, null);
|
||||
}
|
||||
|
||||
public static boolean testDeckValid(DeckValidator validator, List<CardNameAmount> cards, List<CardNameAmount> cardsSideboard) {
|
||||
Deck deckToTest = new Deck();
|
||||
if (cards != null) {
|
||||
for (CardNameAmount cardNameAmount : cards) {
|
||||
CardInfo cardinfo;
|
||||
if (cardNameAmount.getName().isEmpty()) {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber());
|
||||
} else {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getName());
|
||||
}
|
||||
for (int i = 0; i < cardNameAmount.getNumber(); i++) {
|
||||
assert cardinfo != null;
|
||||
deckToTest.getCards().add(cardinfo.getCard());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cardsSideboard != null) {
|
||||
for (CardNameAmount cardNameAmount : cardsSideboard) {
|
||||
CardInfo cardinfo;
|
||||
if (cardNameAmount.getName().isEmpty()) {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber());
|
||||
} else {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getName());
|
||||
}
|
||||
for (int i = 0; i < cardNameAmount.getNumber(); i++) {
|
||||
assert cardinfo != null;
|
||||
deckToTest.getSideboard().add(cardinfo.getCard());
|
||||
}
|
||||
}
|
||||
}
|
||||
return validator.validate(deckToTest);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class DeckTester {
|
||||
private final DeckValidator deckValidator;
|
||||
private final List<DeckValidationUtil.CardNameAmount> maindeck = new ArrayList<>();
|
||||
private final List<DeckValidationUtil.CardNameAmount> sideboard = new ArrayList<>();
|
||||
|
||||
DeckTester(DeckValidator deckValidator) {
|
||||
this.deckValidator = deckValidator;
|
||||
}
|
||||
|
||||
void addMaindeck(String name, int amount) {
|
||||
maindeck.add(new DeckValidationUtil.CardNameAmount(name, amount));
|
||||
}
|
||||
|
||||
void addSideboard(String name, int amount) {
|
||||
sideboard.add(new DeckValidationUtil.CardNameAmount(name, amount));
|
||||
}
|
||||
|
||||
void validate() {
|
||||
validate(null);
|
||||
}
|
||||
|
||||
void validate(String message) {
|
||||
validate(message, true);
|
||||
}
|
||||
|
||||
void validate(String message, boolean expected) {
|
||||
boolean valid = DeckValidationUtil.testDeckValid(deckValidator, maindeck, sideboard);
|
||||
Assert.assertEquals(message != null ? message : deckValidator.getErrorsListInfo(), expected, valid);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package org.mage.test.serverside.deck;
|
||||
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.decks.DeckValidator;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.deck.Commander;
|
||||
import mage.deck.Limited;
|
||||
import mage.deck.Modern;
|
||||
import mage.deck.Standard;
|
||||
|
|
@ -12,68 +10,28 @@ import org.junit.Test;
|
|||
import org.mage.test.serverside.base.MageTestBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.mage.test.serverside.deck.DeckValidationUtil.testDeckValid;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DeckValidatorTest extends MageTestBase {
|
||||
|
||||
static class CardNameAmount {
|
||||
|
||||
String name;
|
||||
String setCode;
|
||||
String cardNumber;
|
||||
|
||||
int number;
|
||||
|
||||
CardNameAmount(String setCode, int cardNumber, int number) {
|
||||
this.name = "";
|
||||
this.setCode = setCode;
|
||||
this.cardNumber = String.valueOf(cardNumber);
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
CardNameAmount(String name, int number) {
|
||||
this.name = name;
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
String getSetCode() {
|
||||
return setCode;
|
||||
}
|
||||
|
||||
String getCardNumber() {
|
||||
return cardNumber;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStandardDeckCardsAmountValid() {
|
||||
ArrayList<CardNameAmount> deck = new ArrayList<>();
|
||||
deck.add(new CardNameAmount("Mountain", 60));
|
||||
|
||||
DeckValidator validator = new Standard();
|
||||
boolean validationSuccessful = testDeckValid(validator, deck);
|
||||
Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful);
|
||||
DeckTester deckTester = new DeckTester(new Standard());
|
||||
deckTester.addMaindeck("Mountain", 60);
|
||||
deckTester.validate();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStandardDeckCardsAmountNotValid() {
|
||||
ArrayList<CardNameAmount> deck = new ArrayList<>();
|
||||
deck.add(new CardNameAmount("Mountain", 59));
|
||||
ArrayList<DeckValidationUtil.CardNameAmount> deck = new ArrayList<>();
|
||||
deck.add(new DeckValidationUtil.CardNameAmount("Mountain", 59));
|
||||
|
||||
ArrayList<CardNameAmount> sideboard = new ArrayList<>();
|
||||
sideboard.add(new CardNameAmount("Mountain", 16));
|
||||
ArrayList<DeckValidationUtil.CardNameAmount> sideboard = new ArrayList<>();
|
||||
sideboard.add(new DeckValidationUtil.CardNameAmount("Mountain", 16));
|
||||
|
||||
DeckValidator validator = new Standard();
|
||||
testDeckValid(validator, deck, sideboard);
|
||||
|
|
@ -83,35 +41,46 @@ public class DeckValidatorTest extends MageTestBase {
|
|||
|
||||
@Test
|
||||
public void testLimitedValid() {
|
||||
ArrayList<CardNameAmount> deck = new ArrayList<>();
|
||||
DeckTester deckTester = new DeckTester(new Limited());
|
||||
deckTester.addMaindeck("Counterspell", 4);
|
||||
deckTester.addMaindeck("Mountain", 36);
|
||||
|
||||
deck.add(new CardNameAmount("Counterspell", 4));
|
||||
deck.add(new CardNameAmount("Mountain", 36));
|
||||
|
||||
Assert.assertTrue("Deck should be valid", testDeckValid(new Limited(), deck));
|
||||
deckTester.validate("Deck should be valid");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLimitedNotValidToLessCards() {
|
||||
ArrayList<CardNameAmount> deckList = new ArrayList<>();
|
||||
DeckTester deckTester = new DeckTester(new Limited());
|
||||
|
||||
deckList.add(new CardNameAmount("Counterspell", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 35));
|
||||
deckTester.addMaindeck("Counterspell", 4);
|
||||
deckTester.addMaindeck("Mountain", 35);
|
||||
|
||||
Assert.assertFalse("Deck should not be valid", testDeckValid(new Limited(), deckList));
|
||||
deckTester.validate("Deck should not be valid", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModern1() {
|
||||
ArrayList<CardNameAmount> deckList = new ArrayList<>();
|
||||
DeckTester deckTester = new DeckTester(new Modern());
|
||||
|
||||
deckList.add(new CardNameAmount("Counterspell", 5));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckTester.addMaindeck("Counterspell", 5);
|
||||
deckTester.addMaindeck("Mountain", 56);
|
||||
|
||||
Assert.assertFalse("only 4 of a card are allowed", testDeckValid(new Modern(), deckList));
|
||||
deckTester.validate("only 4 of a card are allowed", false);
|
||||
}
|
||||
|
||||
private void assertCounterspellValid(ArrayList<CardNameAmount> deckList) {
|
||||
@Test
|
||||
public void testGristCommander() {
|
||||
// Grist, the Hunger Tide can be your commander as its first ability applies during deck construction.
|
||||
DeckTester deckTester = new DeckTester(new Commander());
|
||||
deckTester.addMaindeck("Forest", 49);
|
||||
deckTester.addMaindeck("Swamp", 50);
|
||||
|
||||
deckTester.addSideboard("Grist, the Hunger Tide", 1);
|
||||
|
||||
deckTester.validate("Grist should be legal as a commander");
|
||||
}
|
||||
|
||||
private void assertCounterspellValid(ArrayList<DeckValidationUtil.CardNameAmount> deckList) {
|
||||
final boolean needValid = true; // card valid after Modern Horizons 2
|
||||
boolean valid = testDeckValid(new Modern(), deckList);
|
||||
if (valid != needValid) {
|
||||
|
|
@ -123,113 +92,113 @@ public class DeckValidatorTest extends MageTestBase {
|
|||
public void testModernCounterspell1() {
|
||||
// if card is legal in any set then it must be legal in all other sets too
|
||||
|
||||
ArrayList<CardNameAmount> deckList = new ArrayList<>();
|
||||
deckList.add(new CardNameAmount("JVC", 24, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
ArrayList<DeckValidationUtil.CardNameAmount> deckList = new ArrayList<>();
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("JVC", 24, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("6ED", 61, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("6ED", 61, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("5ED", 77, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("5ED", 77, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("4ED", 65, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("4ED", 65, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("G00", 1, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("G00", 1, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("DD2", 24, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("DD2", 24, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("ICE", 64, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("ICE", 64, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("F05", 11, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("F05", 11, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("LEA", 54, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("LEA", 54, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("LEB", 55, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("LEB", 55, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("ME4", 45, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("ME4", 45, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("ME2", 44, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("ME2", 44, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("S99", 34, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("S99", 34, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("7ED", 67, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("7ED", 67, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("3ED", 54, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("3ED", 54, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("MMQ", 69, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("MMQ", 69, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("VMA", 64, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("VMA", 64, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("2ED", 55, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("2ED", 55, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("TPR", 43, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("TPR", 43, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("TMP", 57, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("TMP", 57, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("MH2", 267, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("MH2", 267, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertCounterspellValid(deckList);
|
||||
}
|
||||
|
||||
private void assertPsychatogValid(ArrayList<CardNameAmount> deckList) {
|
||||
private void assertPsychatogValid(ArrayList<DeckValidationUtil.CardNameAmount> deckList) {
|
||||
// if that card will be valid in modern then you must replace it with another non valid card
|
||||
// google for "Cards Wizards Should Reprint for Modern"
|
||||
final boolean needValid = false;
|
||||
|
|
@ -242,174 +211,137 @@ public class DeckValidatorTest extends MageTestBase {
|
|||
@Test
|
||||
public void testModernPsychatog() {
|
||||
// test non valid card
|
||||
ArrayList<CardNameAmount> deckList = new ArrayList<>();
|
||||
deckList.add(new CardNameAmount("ODY", 292, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
ArrayList<DeckValidationUtil.CardNameAmount> deckList = new ArrayList<>();
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("ODY", 292, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertPsychatogValid(deckList);
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("VMA", 258, 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("VMA", 258, 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
assertPsychatogValid(deckList);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModernBanned() {
|
||||
ArrayList<CardNameAmount> deckList = new ArrayList<>();
|
||||
ArrayList<DeckValidationUtil.CardNameAmount> deckList = new ArrayList<>();
|
||||
DeckValidator validator = new Modern();
|
||||
|
||||
deckList.add(new CardNameAmount("Ancestral Vision", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Ancestral Vision", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
boolean validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Ancient Den", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Ancient Den", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.add(new CardNameAmount("Birthing Pod", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Birthing Pod", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Blazing Shoal", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Blazing Shoal", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Bloodbraid Elf", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Bloodbraid Elf", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Chrome Mox", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Chrome Mox", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Cloudpost", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Cloudpost", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Dark Depths", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Dark Depths", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Deathrite Shaman", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Deathrite Shaman", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Dig Through Time", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Dig Through Time", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Dread Return", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Dread Return", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Glimpse of Nature", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Glimpse of Nature", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Great Furnace", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Great Furnace", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Green Sun's Zenith", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Green Sun's Zenith", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Hypergenesis", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Hypergenesis", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Jace, the Mind Sculptor", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Jace, the Mind Sculptor", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertTrue(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
|
||||
deckList.clear();
|
||||
deckList.add(new CardNameAmount("Mental Misstep", 4));
|
||||
deckList.add(new CardNameAmount("Mountain", 56));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mental Misstep", 4));
|
||||
deckList.add(new DeckValidationUtil.CardNameAmount("Mountain", 56));
|
||||
validationSuccessful = testDeckValid(validator, deckList);
|
||||
Assert.assertFalse(validator.getErrorsListInfo(), validationSuccessful);
|
||||
validator.getErrorsList().clear();
|
||||
}
|
||||
|
||||
private boolean testDeckValid(DeckValidator validator, List<CardNameAmount> cards) {
|
||||
return testDeckValid(validator, cards, null);
|
||||
}
|
||||
|
||||
private boolean testDeckValid(DeckValidator validator, List<CardNameAmount> cards, List<CardNameAmount> cardsSideboard) {
|
||||
Deck deckToTest = new Deck();
|
||||
if (cards != null) {
|
||||
for (CardNameAmount cardNameAmount : cards) {
|
||||
CardInfo cardinfo;
|
||||
if (cardNameAmount.getName().isEmpty()) {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber());
|
||||
} else {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getName());
|
||||
}
|
||||
for (int i = 0; i < cardNameAmount.getNumber(); i++) {
|
||||
assert cardinfo != null;
|
||||
deckToTest.getCards().add(cardinfo.getCard());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cardsSideboard != null) {
|
||||
for (CardNameAmount cardNameAmount : cardsSideboard) {
|
||||
CardInfo cardinfo;
|
||||
if (cardNameAmount.getName().isEmpty()) {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getSetCode(), cardNameAmount.getCardNumber());
|
||||
} else {
|
||||
cardinfo = CardRepository.instance.findCard(cardNameAmount.getName());
|
||||
}
|
||||
for (int i = 0; i < cardNameAmount.getNumber(); i++) {
|
||||
assert cardinfo != null;
|
||||
deckToTest.getSideboard().add(cardinfo.getCard());
|
||||
}
|
||||
}
|
||||
}
|
||||
return validator.validate(deckToTest);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,8 +154,8 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
Assert.assertTrue(
|
||||
"Slot 12 is colorless (" + booster.get(11).getName() + ')',
|
||||
booster.get(11).getColor(null).isColorless()
|
||||
|| booster.get(11).isLand()
|
||||
|| booster.get(11).isArtifact()
|
||||
|| booster.get(11).isLand(currentGame)
|
||||
|| booster.get(11).isArtifact(currentGame)
|
||||
);
|
||||
|
||||
Assert.assertEquals("Slot 15 is from FMB1 set", "FMB1", booster.get(14).getExpansionSetCode());
|
||||
|
|
@ -221,11 +221,11 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
for (int i = 0; i < 50; i++) {
|
||||
List<Card> booster = CoreSet2019.getInstance().createBooster();
|
||||
// check that booster contains a land card
|
||||
assertTrue(booster.stream().anyMatch(card -> card.getCardType().contains(CardType.LAND)));
|
||||
assertTrue(booster.stream().anyMatch(card -> card.getCardType(currentGame).contains(CardType.LAND)));
|
||||
allCards.addAll(booster);
|
||||
}
|
||||
// check that some dual lands were generated
|
||||
assertTrue(allCards.stream().anyMatch(card -> card.getCardType().contains(CardType.LAND) && Objects.equals(card.getRarity(), Rarity.COMMON)));
|
||||
assertTrue(allCards.stream().anyMatch(card -> card.getCardType(currentGame).contains(CardType.LAND) && Objects.equals(card.getRarity(), Rarity.COMMON)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -233,7 +233,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
for (int i = 0; i < 10; i++) {
|
||||
List<Card> booster = WarOfTheSpark.getInstance().createBooster();
|
||||
// check that booster contains a planeswalker
|
||||
assertTrue(booster.stream().anyMatch(MageObject::isPlaneswalker));
|
||||
assertTrue(booster.stream().anyMatch(card -> card.isPlaneswalker(currentGame)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
for (int i = 0; i < 10; i++) {
|
||||
List<Card> booster = Dominaria.getInstance().createBooster();
|
||||
// check that booster contains legendary creature
|
||||
assertTrue(booster.stream().anyMatch(card -> card.isCreature() && card.isLegendary()));
|
||||
assertTrue(booster.stream().anyMatch(card -> card.isCreature(currentGame) && card.isLegendary()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
public void testBattlebond_BoosterMustHaveOneLand() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
List<Card> booster = Battlebond.getInstance().createBooster();
|
||||
assertTrue("battlebond's booster must contain 1 land", booster.stream().anyMatch(card -> card.isBasic() && card.isLand()));
|
||||
assertTrue("battlebond's booster must contain 1 land", booster.stream().anyMatch(card -> card.isBasic() && card.isLand(currentGame)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
assertFalse(str(booster), contains(booster, basics, null));
|
||||
|
||||
// special lands in land slot (can have multiple special lands per booster: one from land slot, one from common slot)
|
||||
List<Card> boosterLands = booster.stream().filter(card -> !card.isBasic() && card.isLand()).collect(Collectors.toList());
|
||||
List<Card> boosterLands = booster.stream().filter(card -> !card.isBasic() && card.isLand(currentGame)).collect(Collectors.toList());
|
||||
Assert.assertTrue("Amonkhet Remastered's booster must contains minimum 1 special land", boosterLands.size() >= 1);
|
||||
|
||||
// Regal Caracal is top-boxer card, not booster
|
||||
|
|
@ -358,7 +358,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
booster.stream().map(Card::getRarity).filter(Rarity.UNCOMMON::equals).count()
|
||||
);
|
||||
|
||||
List<Card> snowLands = booster.stream().filter(card -> card.isSnow() && card.isLand()).collect(Collectors.toList());
|
||||
List<Card> snowLands = booster.stream().filter(card -> card.isSnow() && card.isLand(currentGame)).collect(Collectors.toList());
|
||||
switch (snowLands.size()) {
|
||||
case 0:
|
||||
fail("Booster must have snow lands");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue