use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.
the class LastPageTest method testFormatDoubleDash.
@Test
public void testFormatDoubleDash() {
LayoutFormatter a = new LastPage();
Assert.assertEquals("350", a.format("345--350"));
}
use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.
the class LastPageTest method testFinalCoverageCase.
@Test
public void testFinalCoverageCase() {
LayoutFormatter a = new LastPage();
Assert.assertEquals("", a.format("--"));
}
use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.
the class NoSpaceBetweenAbbreviationsTest method testFormat.
@Test
public void testFormat() {
LayoutFormatter f = new NoSpaceBetweenAbbreviations();
Assert.assertEquals("", f.format(""));
Assert.assertEquals("John Meier", f.format("John Meier"));
Assert.assertEquals("J.F. Kennedy", f.format("J. F. Kennedy"));
Assert.assertEquals("J.R.R. Tolkien", f.format("J. R. R. Tolkien"));
Assert.assertEquals("J.R.R. Tolkien and J.F. Kennedy", f.format("J. R. R. Tolkien and J. F. Kennedy"));
}
use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.
the class FirstPageTest method testFormatSinglePage.
@Test
public void testFormatSinglePage() {
LayoutFormatter a = new FirstPage();
Assert.assertEquals("345", a.format("345"));
}
use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.
the class AuthorAndsCommaReplacerTest method testFormat.
/**
* Test method for
* {@link org.jabref.logic.layout.format.AuthorAndsCommaReplacer#format(java.lang.String)}.
*/
@Test
public void testFormat() {
LayoutFormatter a = new AuthorAndsCommaReplacer();
// Empty case
Assert.assertEquals("", a.format(""));
// Single Names don't change
Assert.assertEquals("Someone, Van Something", a.format("Someone, Van Something"));
// Two names just an &
Assert.assertEquals("John von Neumann & Peter Black Brown", a.format("John von Neumann and Peter Black Brown"));
// Three names put a comma:
Assert.assertEquals("von Neumann, John, Smith, John & Black Brown, Peter", a.format("von Neumann, John and Smith, John and Black Brown, Peter"));
}
Aggregations