use of mage.cards.decks.importer.TxtDeckImporter in project mage by magefree.
the class TxtDeckImporterTest method testImportWithBlankLineAboveSideboard.
@Test
public void testImportWithBlankLineAboveSideboard() {
TxtDeckImporter importer = new TxtDeckImporter(false);
CardInfo card;
DeckCardLists deck = new DeckCardLists();
String[] cards = { "Plains", "Forest", "Island" };
String[] sideboard = { "Swamp", "Mountain" };
for (String c : cards) {
card = CardRepository.instance.findPreferredCoreExpansionCard(c, true);
assert card != null;
deck.getCards().add(new DeckCardInfo(card.getName(), card.getCardNumber(), card.getSetCode()));
}
for (String s : sideboard) {
card = CardRepository.instance.findPreferredCoreExpansionCard(s, true);
assert card != null;
deck.getSideboard().add(new DeckCardInfo(card.getName(), card.getCardNumber(), card.getSetCode()));
}
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", 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());
}
Aggregations