mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
Move tests to the Mage directory and stub out looking up cards by names for tests.
This commit is contained in:
parent
58e629dca6
commit
5bf748e2b5
12 changed files with 232 additions and 75 deletions
|
|
@ -1,44 +0,0 @@
|
|||
package mage.cards.decks.importer;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import mage.cards.decks.DeckCardInfo;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
|
||||
public class CodDeckImportTest {
|
||||
|
||||
@Test
|
||||
public void testImportCod() {
|
||||
StringBuilder errors = new StringBuilder();
|
||||
DeckCardLists deck = new CodDeckImporter().importDeck(
|
||||
"src/test/java/mage/cards/decks/importer/testdeck.cod", errors);
|
||||
assertEquals("Deck Name", deck.getName());
|
||||
assertEquals(113, deck.getCards().size());
|
||||
assertEquals(3, deck.getSideboard().size());
|
||||
int index = 0;
|
||||
for (int i = 0; i < 12; i++) {
|
||||
assertCardSame("Forest", deck.getCards().get(index++));
|
||||
}
|
||||
for (int i = 0; i < 100; i++) {
|
||||
assertCardSame("Razorverge Thicket", deck.getCards().get(index++));
|
||||
}
|
||||
assertCardSame("Avacyn's Pilgrim", deck.getCards().get(index++));
|
||||
assertEquals(index, deck.getCards().size());
|
||||
|
||||
index = 0;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
assertCardSame("War Priest of Thune", deck.getSideboard().get(index++));
|
||||
}
|
||||
assertEquals(index, deck.getSideboard().size());
|
||||
|
||||
assertEquals("Could not find card: '@#$NOT A REAL CARD NAME@#$'\n", errors.toString());
|
||||
}
|
||||
|
||||
private static void assertCardSame(String name, DeckCardInfo card) {
|
||||
assertEquals(name, card.getCardName());
|
||||
assertEquals(1, card.getQuantity());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package mage.cards.decks.importer;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
|
||||
public class DecDeckImportTest {
|
||||
|
||||
@Test
|
||||
public void testImport() {
|
||||
StringBuilder errors = new StringBuilder();
|
||||
DeckCardLists deck = new DecDeckImporter().importDeck(
|
||||
"src/test/java/mage/cards/decks/importer/testdeck.dec", errors);
|
||||
assertEquals(60, deck.getCards().size());
|
||||
assertEquals(15, deck.getSideboard().size());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cockatrice_deck version="1">
|
||||
<deckname>Deck Name </deckname>
|
||||
<comments>Some comments in here.</comments>
|
||||
<zone name="main">
|
||||
<card number="12" name="Forest"/>
|
||||
<card number="101" price="0" name="Razorverge Thicket"/>
|
||||
<card price="0" name="Avacyn's Pilgrim"/>
|
||||
<card number="1" price="0" name="@#$NOT A REAL CARD NAME@#$"/>
|
||||
</zone>
|
||||
<zone name="side">
|
||||
<card number="3" price="0" name="War Priest of Thune"/>
|
||||
</zone>
|
||||
</cockatrice_deck>
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
// Name: Mono-Blue Tinker from MTGSalvation.com via mtgtrice mtg-decks
|
||||
// Creatures
|
||||
4 Masticore
|
||||
4 Metalworker
|
||||
1 Phyrexian Colossus
|
||||
// Artifacts
|
||||
1 Crumbling Sanctuary
|
||||
4 Grim Monolith
|
||||
1 Mishra's Helix
|
||||
4 Phyrexian Processor
|
||||
4 Tangle Wire
|
||||
4 Thran Dynamo
|
||||
4 Voltaic Key
|
||||
// Sorceries
|
||||
4 Tinker
|
||||
// Instants
|
||||
4 Brainstorm
|
||||
// Lands
|
||||
4 Crystal Vein
|
||||
9 Island
|
||||
4 Rishadan Port
|
||||
4 Saprazzan Skerry
|
||||
// Sideboard
|
||||
SB: 4 Annul
|
||||
SB: 4 Chill
|
||||
SB: 4 Miscalculation
|
||||
SB: 1 Mishra's Helix
|
||||
SB: 2 Rising Waters
|
||||
Loading…
Add table
Add a link
Reference in a new issue