package de.flux.playground.deckcompare.importer;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;

import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;

import org.junit.Test;

import de.flux.playground.deckcompare.dto.Deck;

public class DeckImporterTest {

    @Test
    public void importDeck() throws Exception {
        DeckImporter importer = new DeckImporter();

        File deckFile = obtainDeckFile("the-fun-ends-here-shl-jinteki-edition-1st-.o8d");
        Deck deck = importer.importDeck(deckFile);

        assertThat(deck.getGame(), is(not("")));
        assertThat(deck.getSection(), is(not(empty())));
        assertThat(deck.getNotes(), is(not("")));
    }

    private File obtainDeckFile(String fileName) throws URISyntaxException {
        URL url = DeckImporterTest.class.getResource(fileName);
        File deckFile = new File(url.toURI());
        return deckFile;
    }

}

@@ -188,51 +188,8 @@
 hat;
-%0Aimport static org.hamcrest.Matchers.empty;
 %0A%0Aim
@@ -371,16 +371,114 @@
 Test %7B%0A%0A
+    private static final int FIRST_SECTION = 0;%0A    private static final int SECOND_SECTION = 1;%0A%0A
     @Tes
@@ -764,125 +764,681 @@
  is(
-not(%22%22)));%0A        assertThat(deck.getSection(), is(not(empty())));%0A        assertThat(deck.getNotes(), is(not(%22%22)));
+%220f38e453-26df-4c04-9d67-6d43de939c77%22));%0A        assertSections(deck);%0A        assertThat(deck.getNotes(), is(not(%22%22)));%0A    %7D%0A%0A    private void assertSections(Deck deck) %7B%0A        assertThat(deck.getSection().size(), is(2));%0A        assertIdentity(deck);%0A        assertCardsOfDeck(deck);%0A    %7D%0A%0A    private void assertIdentity(Deck deck) %7B%0A        assertThat(deck.getSection().get(FIRST_SECTION).getCard().size(), is(1));%0A        // TODO: add more asserts for the identity%0A    %7D%0A%0A    private void assertCardsOfDeck(Deck deck) %7B%0A        assertThat(deck.getSection().get(SECOND_SECTION).getCard().size(), is(24));%0A        // TODO: add more asserts for the cards of the deck
 %0A   

Add more specific asserts for the imported deck