Search in sources :

Example 16 with LayoutFormatter

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"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 17 with LayoutFormatter

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("--"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 18 with LayoutFormatter

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"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 19 with LayoutFormatter

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"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 20 with LayoutFormatter

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"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Aggregations

LayoutFormatter (org.jabref.logic.layout.LayoutFormatter)33 Test (org.junit.Test)33