Merge pull request #6190 from luziferius/refactor_promo_sets

[RFC] Refactor promo sets, add missing sets as listed on Scryfall
This commit is contained in:
Oleg Agafonov 2020-08-10 16:57:00 +02:00 committed by GitHub
commit b16d30b79b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
438 changed files with 14861 additions and 3880 deletions

View file

@ -35,7 +35,7 @@ public class TxtDeckImporterTest {
Assert.assertEquals("Deck does not contain 3 cards, found " + deck.getCards().size(), 3, deck.getCards().size());
Assert.assertEquals("Sideboard does not contain 2 cards, found " + deck.getSideboard().size(), 2, deck.getSideboard().size());
DeckCardLists imported = importer.importDeck("JustLands.txt");
DeckCardLists imported = importer.importDeck("JustLands.txt", false);
Assert.assertEquals("Imported deck does not contain 3 cards, found " + imported.getCards().size(), 3, imported.getCards().size());
Assert.assertEquals("Imported sideboard does not contain 2 cards, found " + imported.getSideboard().size(), 2, imported.getSideboard().size());

View file

@ -59,46 +59,60 @@ public class LoadTest {
Deck deck;
deck = DeckTestUtils.buildRandomDeck("G", false);
Assert.assertNotNull(deck);
for (Card card : deck.getCards()) {
Assert.assertNotNull(card);
Assert.assertTrue("card " + card.getName() + " color " + card.getColorIdentity().toString() + " must be in G",
card.getColorIdentity().isGreen());
}
deck = DeckTestUtils.buildRandomDeck("U", false);
Assert.assertNotNull(deck);
for (Card card : deck.getCards()) {
Assert.assertNotNull(card);
Assert.assertTrue("card " + card.getName() + " color " + card.getColorIdentity().toString() + " must be in U",
card.getColorIdentity().isBlue());
}
deck = DeckTestUtils.buildRandomDeck("BR", false);
Assert.assertNotNull(deck);
for (Card card : deck.getCards()) {
Assert.assertNotNull(card);
Assert.assertTrue("card " + card.getName() + " color " + card.getColorIdentity().toString() + " must be in BR",
card.getColorIdentity().isBlack() || card.getColorIdentity().isRed());
}
deck = DeckTestUtils.buildRandomDeck("BUG", false);
Assert.assertNotNull(deck);
for (Card card : deck.getCards()) {
Assert.assertNotNull(card);
Assert.assertTrue("card " + card.getName() + " color " + card.getColorIdentity().toString() + " must be in BUG",
card.getColorIdentity().isBlack() || card.getColorIdentity().isBlue() || card.getColorIdentity().isGreen());
}
// lands
deck = DeckTestUtils.buildRandomDeck("UR", true);
Assert.assertNotNull(deck);
for (Card card : deck.getCards()) {
Assert.assertNotNull(card);
Assert.assertTrue("card " + card.getName() + " color " + card.getColorIdentity().toString() + " must be in UR",
card.getColorIdentity().isBlue() || card.getColorIdentity().isRed());
Assert.assertEquals("card " + card.getName() + " must be basic land ", Rarity.LAND, card.getRarity());
}
deck = DeckTestUtils.buildRandomDeck("B", true);
Assert.assertNotNull(deck);
for (Card card : deck.getCards()) {
Assert.assertNotNull(card);
Assert.assertTrue("card " + card.getName() + " color " + card.getColorIdentity().toString() + " must be in B", card.getColorIdentity().isBlack());
Assert.assertEquals("card " + card.getName() + " must be basic land ", Rarity.LAND, card.getRarity());
}
// allowed sets
deck = DeckTestUtils.buildRandomDeck("B", true, "GRN");
Assert.assertNotNull(deck);
for (Card card : deck.getCards()) {
Assert.assertNotNull(card);
Assert.assertTrue("card " + card.getName() + " color " + card.getColorIdentity().toString() + " must be in B", card.getColorIdentity().isBlack());
Assert.assertEquals("card " + card.getName() + " have wrong set code " + card.getExpansionSetCode(), "GRN", card.getExpansionSetCode());
}

View file

@ -248,7 +248,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
if (loadedDeckCardLists.containsKey(deckName)) {
list = loadedDeckCardLists.get(deckName);
} else {
list = DeckImporter.importDeckFromFile(deckName);
list = DeckImporter.importDeckFromFile(deckName, true);
loadedDeckCardLists.put(deckName, list);
}
Deck deck = Deck.load(list, false, false);

View file

@ -114,7 +114,7 @@ public class DeckValidatorTest extends MageTestBase {
@Test
public void testModernCounterspell1() {
ArrayList<CardNameAmount> deckList = new ArrayList<>();
deckList.add(new CardNameAmount("DD3JVC", 24, 4));
deckList.add(new CardNameAmount("JVC", 24, 4));
deckList.add(new CardNameAmount("Mountain", 56));
Assert.assertFalse("Counterspell not allowed in modern", testDeckValid(new Modern(), deckList));
@ -134,7 +134,7 @@ public class DeckValidatorTest extends MageTestBase {
Assert.assertFalse("Counterspell not allowed in modern", testDeckValid(new Modern(), deckList));
deckList.clear();
deckList.add(new CardNameAmount("JR", 5, 4));
deckList.add(new CardNameAmount("G00", 1, 4));
deckList.add(new CardNameAmount("Mountain", 56));
Assert.assertFalse("Counterspell not allowed in modern", testDeckValid(new Modern(), deckList));
@ -149,7 +149,7 @@ public class DeckValidatorTest extends MageTestBase {
Assert.assertFalse("Counterspell not allowed in modern", testDeckValid(new Modern(), deckList));
deckList.clear();
deckList.add(new CardNameAmount("FNMP", 66, 4));
deckList.add(new CardNameAmount("F05", 11, 4));
deckList.add(new CardNameAmount("Mountain", 56));
Assert.assertFalse("Counterspell not allowed in modern", testDeckValid(new Modern(), deckList));
@ -213,11 +213,6 @@ public class DeckValidatorTest extends MageTestBase {
deckList.add(new CardNameAmount("Mountain", 56));
Assert.assertFalse("Counterspell not allowed in modern", testDeckValid(new Modern(), deckList));
deckList.clear();
deckList.add(new CardNameAmount("S00", 12, 4));
deckList.add(new CardNameAmount("Mountain", 56));
Assert.assertFalse("Counterspell not allowed in modern", testDeckValid(new Modern(), deckList));
}
@Test