Search in sources :

Example 6 with LayoutFormatter

use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.

the class FirstPageTest method testFormatSingleDash.

@Test
public void testFormatSingleDash() {
    LayoutFormatter a = new FirstPage();
    Assert.assertEquals("345", a.format("345-350"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 7 with LayoutFormatter

use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.

the class HTMLParagraphsTest method testFormat.

@Test
public void testFormat() {
    LayoutFormatter f = new HTMLParagraphs();
    Assert.assertEquals("", f.format(""));
    Assert.assertEquals("<p>\nHello\n</p>", f.format("Hello"));
    Assert.assertEquals("<p>\nHello\nWorld\n</p>", f.format("Hello\nWorld"));
    Assert.assertEquals("<p>\nHello World\n</p>\n<p>\nWhat a lovely day\n</p>", f.format("Hello World\n   \nWhat a lovely day\n"));
    Assert.assertEquals("<p>\nHello World\n</p>\n<p>\nCould not be any better\n</p>\n<p>\nWhat a lovely day\n</p>", f.format("Hello World\n \n\nCould not be any better\n\nWhat a lovely day\n"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 8 with LayoutFormatter

use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.

the class FirstPageTest method testFormatEmpty.

@Test
public void testFormatEmpty() {
    LayoutFormatter a = new FirstPage();
    Assert.assertEquals("", a.format(""));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 9 with LayoutFormatter

use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.

the class FirstPageTest method testFormatDoubleDash.

@Test
public void testFormatDoubleDash() {
    LayoutFormatter a = new FirstPage();
    Assert.assertEquals("345", a.format("345--350"));
}
Also used : LayoutFormatter(org.jabref.logic.layout.LayoutFormatter) Test(org.junit.Test)

Example 10 with LayoutFormatter

use of org.jabref.logic.layout.LayoutFormatter in project jabref by JabRef.

the class AuthorLastFirstCommasTest method testFormat.

/**
     * Test method for
     * {@link org.jabref.logic.layout.format.AuthorLastFirstCommas#format(java.lang.String)}.
     */
@Test
public void testFormat() {
    LayoutFormatter a = new AuthorLastFirstCommas();
    // Empty case
    Assert.assertEquals("", a.format(""));
    // Single Names
    Assert.assertEquals("Someone, Van Something", a.format("Van Something Someone"));
    // Two names
    Assert.assertEquals("von Neumann, John and Black Brown, Peter", a.format("John von Neumann and Black Brown, Peter"));
    // Three names
    Assert.assertEquals("von Neumann, John, Smith, John and Black Brown, Peter", a.format("von Neumann, John and Smith, John and Black Brown, Peter"));
    Assert.assertEquals("von Neumann, John, Smith, John and Black Brown, Peter", a.format("John von Neumann and John Smith 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