@Test public void testWrapTextUsingHtml() { String word4 = "test"; String word3 = "<text>she</text>"; String word0 = "<text />"; String word2 = "he"; String word6 = "<text >desire</text>"; String text = word4 + " " + word3 + " " + word0 + word2 + " " + word6; String exp = word4 + " " + word3 + " " + word0 + "<br>" + word2 + " " + word6; String act = MiscUtils.wrapText(text, 10, true, true); assertEquals(exp, act); }
@Test public void testWrapText() { String word5 = "apple"; String word4 = "keys"; String word3 = "yes"; String text = word5 + " " + word4 + " " + word3 + "\n" + word5 + " " + word4; String expected = word5 + " " + word4 + "\n" + word3 + "\n" + word5 + " " + word4; String actual = MiscUtils.wrapText(text, 10); assertEquals(expected, actual); }