/** * */ public TitleBuffer append(final int number) { append(String.valueOf(number)); return this; }
public String title() { final TitleBuffer buf = new TitleBuffer(); buf.append(name); return buf.toString(); }
@Test public void testAppendObjectWhereDefaultUsedAsObjectHasEmptyTitle() { t1.append(objectWithEmptyTitle, "none"); assertEquals(name + " " + "none", t1.toString()); }
@Test public void testAppendObjectsWithJoinerAddsTitleWithJoinerAndSpace() { t1.append(",", objectWithTitle); assertEquals(name + ", " + companyName, t1.toString()); }
@Test public void testAppendObjectWhereDefaultNotNeeded() { t1.append(objectWithTitle, "none"); assertEquals(name + " " + companyName, t1.toString()); }
@Test public void testAppendObjectWithTitleAddTitleWithSpace() { t1.append(objectWithTitle); assertEquals(name + " " + companyName, t1.toString()); }
@Test public void testAppendObjectWhereDefaultUsedAsReferenceIsNull() { t1.append((Object) null, "none"); assertEquals(name + " " + "none", t1.toString()); }
@Test public void testAppendObjectWithEmptyTitleLeavesBufferUnchanged() { t1.append(objectWithEmptyTitle); assertEquals(name, t1.toString()); }
@Test public void testAppendStringToEmptyBufferAddsStringWithoutSpace() { t2.append("Smith"); assertEquals("Smith", t2.toString()); }
@Test public void testAppendNull() { t1.append(null); assertEquals(name, t1.toString()); }
@Test public void testAppendStringAddStringWithSpace() { t1.append("Smith"); assertEquals("Fred Smith", t1.toString()); }
@Test public void testAppendStringWithJoinerAddsStringWithJoinerAndSpace() { t1.append(",", "Smith"); assertEquals("Fred, Smith", t1.toString()); }
@Test public void testAppendEmptyStringLeavesBufferUnchanged() { t1.append(""); assertEquals(name, t1.toString()); }
@Test public void testAppendObjectsWithJoinerOnlyAddsTitleWhenBufferEmpty() { t2.append(",", objectWithTitle); assertEquals(name, t1.toString()); }
@Test public void testAppendObjectWithNoTitleLeavesBufferUnchanged() { t1.append(objectWithNoTitle); assertEquals(name, t1.toString()); }
@Test public void testAppendNullWithJoinerLeavesBufferUnchanged() { t1.append(",", (Object) null); assertEquals(name, t1.toString()); }
@Test public void testAppendInt() { final TitleBuffer t = new TitleBuffer(); t.append(123); assertEquals("123", t.toString()); }
@Test public void testAppendToBuffer() { final TitleBuffer t = new TitleBuffer("123"); t.append("test"); assertEquals("123 test", t.toString()); }
@Test public void testAppendToEmpty() { final TitleBuffer t = new TitleBuffer(); t.append("test"); assertEquals("test", t.toString()); }