From 8ddcf131bc1840df2e9e2d15da5007ba94ea0722 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 8 Jun 2014 19:25:24 +0200 Subject: [PATCH] Add test for StringList. --- test/fr/devinsy/util/StringListTest.java | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/test/fr/devinsy/util/StringListTest.java b/test/fr/devinsy/util/StringListTest.java index 254a16b..368afac 100644 --- a/test/fr/devinsy/util/StringListTest.java +++ b/test/fr/devinsy/util/StringListTest.java @@ -232,4 +232,72 @@ public class StringListTest 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."); + } }