mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
Fixed mtgo deck export (sorting, empty lines);
This commit is contained in:
parent
4fde77b05e
commit
a2feda38ce
2 changed files with 46 additions and 32 deletions
|
|
@ -15,18 +15,21 @@ public class MtgoDeckExporterTest {
|
|||
public void writeDeck() throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
DeckCardLists deck = new DeckCardLists();
|
||||
deck.getCards().add(new DeckCardInfo("Forest", "RNA", "1", 2));
|
||||
deck.getCards().add(new DeckCardInfo("Plains", "RNA", "2", 3));
|
||||
deck.getSideboard().add(new DeckCardInfo("Island", "RNA", "3", 2));
|
||||
deck.getCards().add(new DeckCardInfo("Forest", "1", "RNA", 2));
|
||||
deck.getCards().add(new DeckCardInfo("Plains", "2", "RNA", 3));
|
||||
deck.getCards().add(new DeckCardInfo("Plains", "2", "RNA", 5)); // must combine
|
||||
deck.getCards().add(new DeckCardInfo("Mountain", "3", "RNA", 1));
|
||||
deck.getSideboard().add(new DeckCardInfo("Island", "1", "RNA", 2));
|
||||
deck.getSideboard().add(new DeckCardInfo("Island", "1", "RNA", 5)); // must combine
|
||||
deck.getSideboard().add(new DeckCardInfo("Mountain", "2", "RNA", 3));
|
||||
MtgoDeckExporter exporter = new MtgoDeckExporter();
|
||||
exporter.writeDeck(baos, deck);
|
||||
assertEquals("2 Forest" + System.lineSeparator() +
|
||||
"3 Plains" + System.lineSeparator() +
|
||||
"8 Plains" + System.lineSeparator() +
|
||||
"1 Mountain" + System.lineSeparator() +
|
||||
System.lineSeparator() +
|
||||
System.lineSeparator() +
|
||||
"2 Island" + System.lineSeparator() +
|
||||
System.lineSeparator(),
|
||||
"7 Island" + System.lineSeparator() +
|
||||
"3 Mountain" + System.lineSeparator(),
|
||||
baos.toString());
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue