forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_331Test.java
49 lines (39 loc) · 1.23 KB
/
_331Test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.fishercoder;
import com.fishercoder.solutions._331;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by fishercoder on 5/29/17.
*/
public class _331Test {
private static _331 test;
@BeforeClass
public static void setup(){
test = new _331();
}
@Test
public void test1(){
assertEquals(true, test.isValidSerialization_clever_solution("9,3,4,#,#,1,#,#,2,#,6,#,#"));
assertEquals(true, test.isValidSerialization("9,3,4,#,#,1,#,#,2,#,6,#,#"));
}
@Test
public void test2(){
assertEquals(false, test.isValidSerialization_clever_solution("1,#"));
assertEquals(false, test.isValidSerialization("1,#"));
}
@Test
public void test3(){
assertEquals(false, test.isValidSerialization_clever_solution("9,#,#,1"));
assertEquals(false, test.isValidSerialization("9,#,#,1"));
}
@Test
public void test4(){
assertEquals(false, test.isValidSerialization_clever_solution("1"));
assertEquals(false, test.isValidSerialization("1"));
}
@Test
public void test5(){
assertEquals(true, test.isValidSerialization_clever_solution("#,7,6,9,#,#,#"));
}
}