Skip to content

Commit

Permalink
Add test for unknown custom entry types
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb committed Dec 10, 2015
1 parent 92ebf7e commit 3495a52
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import net.sf.jabref.model.entry.BibLatexEntryTypes;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibtexEntryTypes;
import net.sf.jabref.model.entry.CustomEntryType;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

Expand Down Expand Up @@ -44,4 +46,12 @@ public void detectUndistinguishableAsBibtex() {

assertEquals(BibDatabaseType.BIBTEX, BibDatabaseTypeDetection.inferType(entries));
}

@Test
public void detectUnknownTypeAsBibtex() {

This comment has been minimized.

Copy link
@tobiasdiez

tobiasdiez Dec 10, 2015

Member

Can you reformulate this as an assertion, i.e. unknownTypeIsDetectedAsBibex or something similar.

BibEntry entry = new BibEntry("someid", new CustomEntryType("unknowntype", new ArrayList<>(0), new ArrayList<>(0)));
Collection<BibEntry> entries = Arrays.asList(entry);

assertEquals(BibDatabaseType.BIBTEX, BibDatabaseTypeDetection.inferType(entries));
}
}

0 comments on commit 3495a52

Please sign in to comment.