Skip to content

Commit

Permalink
Increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb committed Dec 10, 2015
1 parent b930c78 commit 4a3bf5d
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ public void detectBibtexBasedOnFields() {
assertEquals(BibDatabaseType.BIBTEX, BibDatabaseTypeDetection.inferType(entries));
}

@Test
public void detectUnknownBasedOnFields() {
BibEntry entry = new BibEntry("someid", new CustomEntryType("unknowntype", new ArrayList<>(0), new ArrayList<>(0)));
entry.setField("someunknownfield", "value");
Collection<BibEntry> entries = Arrays.asList(entry);

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

@Test
public void detectUndistinguishableAsBibtex() {
BibEntry entry = new BibEntry("someid", BibtexEntryTypes.ARTICLE);
Expand All @@ -59,6 +68,7 @@ public void detectSingleUnknownTypeAsBibtex() {
public void ignoreUnknownTypesForDecision() {
// BibTex
BibEntry custom = new BibEntry("someid", new CustomEntryType("unknowntype", new ArrayList<>(0), new ArrayList<>(0)));
custom.setField("someunknownfield", "value");
BibEntry bibtex = new BibEntry("someid", BibtexEntryTypes.ARTICLE);
Collection<BibEntry> entries = Arrays.asList(custom, bibtex);

Expand Down

0 comments on commit 4a3bf5d

Please sign in to comment.