Search in sources :

Example 1 with MtgArenaDeckExporter

use of mage.cards.decks.exporter.MtgArenaDeckExporter in project mage by magefree.

the class MtgArenaDeckExporterTest method writeDeck.

@Test
public void writeDeck() throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DeckCardLists deck = new DeckCardLists();
    deck.getCards().add(new DeckCardInfo("Forest", "1", "RNA", 2));
    deck.getCards().add(new DeckCardInfo("Plains", "2", "RNA", 3));
    // must combine
    deck.getCards().add(new DeckCardInfo("Plains", "2", "RNA", 5));
    deck.getCards().add(new DeckCardInfo("Mountain", "3", "RNA", 1));
    deck.getCards().add(new DeckCardInfo("Goblin Chainwhirler", "129", "DOM", 4));
    deck.getSideboard().add(new DeckCardInfo("Island", "1", "RNA", 2));
    // must combine
    deck.getSideboard().add(new DeckCardInfo("Island", "1", "RNA", 5));
    deck.getSideboard().add(new DeckCardInfo("Mountain", "2", "RNA", 3));
    DeckExporter exporter = new MtgArenaDeckExporter();
    exporter.writeDeck(baos, deck);
    assertEquals("2 Forest (RNA) 1" + System.lineSeparator() + "8 Plains (RNA) 2" + System.lineSeparator() + "1 Mountain (RNA) 3" + System.lineSeparator() + "4 Goblin Chainwhirler (DAR) 129" + System.lineSeparator() + System.lineSeparator() + "7 Island (RNA) 1" + System.lineSeparator() + "3 Mountain (RNA) 2" + System.lineSeparator(), baos.toString());
}
Also used : DeckCardLists(mage.cards.decks.DeckCardLists) MtgArenaDeckExporter(mage.cards.decks.exporter.MtgArenaDeckExporter) DeckExporter(mage.cards.decks.exporter.DeckExporter) DeckCardInfo(mage.cards.decks.DeckCardInfo) MtgArenaDeckExporter(mage.cards.decks.exporter.MtgArenaDeckExporter) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DeckCardInfo (mage.cards.decks.DeckCardInfo)1 DeckCardLists (mage.cards.decks.DeckCardLists)1 DeckExporter (mage.cards.decks.exporter.DeckExporter)1 MtgArenaDeckExporter (mage.cards.decks.exporter.MtgArenaDeckExporter)1 Test (org.junit.Test)1