Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ca0229b

Browse files
authored
create Unit test for StringCompression.java
add test case for StringCompression.java
1 parent 9d705a5 commit ca0229b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.ctci.arraysandstrings;
2+
3+
import static org.hamcrest.CoreMatchers.nullValue;
4+
5+
import org.junit.Before;
6+
import org.junit.Test;
7+
8+
public class StringCompressionUnitTest {
9+
public static String str1;
10+
11+
public static String str2;
12+
13+
public static String str3;
14+
15+
@Before
16+
public void setup() {
17+
str1 = "aaabbccaaaaa";
18+
str2 = "adddcc2";
19+
str3 = "";
20+
}
21+
22+
@Test
23+
public void testCompressStr() {
24+
System.out.println(str1 + ": " + StringCompression.compressString(str1));
25+
System.out.println(str2 + ": " + StringCompression.compressString(str2));
26+
System.out.println(str3 + ": " + StringCompression.compressString(str3));
27+
}
28+
}

0 commit comments

Comments
 (0)