01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.util;
04:
05: import junit.framework.TestCase;
06:
07: public class StringUtilTest extends TestCase {
08: public void testCombineArraysBothEmpty() {
09: assertEquals(0, StringUtil.combineArrays(new String[] {},
10: new String[] {}).length);
11: }
12:
13: public void testCombineArraysWithOneItemInFirst() {
14: String[] first = new String[] { "a" };
15: String[] result = StringUtil.combineArrays(first,
16: new String[] {});
17: assertEquals(1, result.length);
18: assertEquals("a", result[0]);
19: }
20:
21: public void testCombineArraysWithOneItemInEach() {
22: String[] first = new String[] { "a" };
23: String[] second = new String[] { "b" };
24: String[] result = StringUtil.combineArrays(first, second);
25: assertEquals(2, result.length);
26: assertEquals("a", result[0]);
27: assertEquals("b", result[1]);
28: }
29:
30: public void testCombineArraysWithMixedNumbers() {
31: String[] first = new String[] { "a", "b", "c" };
32: String[] second = new String[] { "d", "e" };
33: String[] result = StringUtil.combineArrays(first, second);
34: assertEquals(5, result.length);
35: assertEquals("a", result[0]);
36: assertEquals("b", result[1]);
37: assertEquals("c", result[2]);
38: assertEquals("d", result[3]);
39: assertEquals("e", result[4]);
40: }
41: }
|