1 /**
2 *
3 */
4 package net.sf.statsvn.util;
5
6 import junit.framework.TestCase;
7
8 /**
9 * @author Benoit Xhenseval
10 *
11 */
12 public class SvnInfoUtilTest extends TestCase {
13 public void testReplace() {
14 assertEquals("String with no space", "thisisatest", SvnInfoUtils.replace(" ", "%20", "thisisatest"));
15 assertEquals("null String", null, SvnInfoUtils.replace(" ", "%20", null));
16 assertEquals("empty String", "", SvnInfoUtils.replace(" ", "%20", ""));
17 assertEquals("null pattern", "thisisatest", SvnInfoUtils.replace(null, "%20", "thisisatest"));
18 assertEquals("empty pattern", "thisisatest", SvnInfoUtils.replace("", "%20", "thisisatest"));
19 assertEquals("1 pattern", "this%20isatest", SvnInfoUtils.replace(" ", "%20", "this isatest"));
20 assertEquals("2 patterns", "this%20is%20atest", SvnInfoUtils.replace(" ", "%20", "this is atest"));
21 assertEquals("3 patterns", "this%20is%20a%20test", SvnInfoUtils.replace(" ", "%20", "this is a test"));
22 assertEquals("4 patterns", "%20this%20is%20a%20test", SvnInfoUtils.replace(" ", "%20", " this is a test"));
23 assertEquals("5 patterns", "%20this%20is%20a%20%20test", SvnInfoUtils.replace(" ", "%20", " this is a test"));
24 assertEquals("6 patterns", "%20this%20is%20a%20%20test%20", SvnInfoUtils.replace(" ", "%20", " this is a test "));
25 }
26 }