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"));
}
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"));
}
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(""));
}
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"));
}
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"));
}
Aggregations