Add test for StringList.

This commit is contained in:
Christian P. MOMON 2014-06-08 19:25:24 +02:00
parent b05606df83
commit 8ddcf131bc

View file

@ -232,4 +232,72 @@ public class StringListTest
logger.debug("===== test done."); logger.debug("===== test done.");
} }
/**
*
*/
@Test
public void testToString01()
{
//
logger.debug("===== test starting...");
//
StringList buffer = new StringList();
String target = buffer.toString();
Assert.assertTrue(target.equals(""));
//
logger.debug("===== test done.");
}
/**
*
*/
@Test
public void testToString02()
{
//
logger.debug("===== test starting...");
//
String source = "abcdefghijklm";
StringList buffer = new StringList();
buffer.append(source);
String target = buffer.toString();
Assert.assertEquals(source, target);
Assert.assertTrue(target.equals(source));
//
logger.debug("===== test done.");
}
/**
*
*/
@Test
public void testToString03()
{
//
logger.debug("===== test starting...");
//
String source1 = "abcdefghijklm";
String source2 = "other stuff";
StringList buffer = new StringList();
buffer.append(source1);
buffer.append(source2);
String target = buffer.toString();
Assert.assertTrue(target.equals(source1 + source2));
//
logger.debug("===== test done.");
}
} }