Skip to content

Commit 829f5a5

Browse files
refactor 116
1 parent 0522cd8 commit 829f5a5

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

src/test/java/com/fishercoder/_116Test.java

+30-16
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,37 @@
66
import org.junit.Test;
77

88
public class _116Test {
9-
private static _116.Solution1 solution1;
10-
private static TreeLinkNode root;
9+
private static _116.Solution1 solution1;
10+
private static _116.Solution2 solution2;
11+
private static TreeLinkNode root;
1112

12-
@BeforeClass
13-
public static void setup() {
14-
solution1 = new _116.Solution1();
15-
}
13+
@BeforeClass
14+
public static void setup() {
15+
solution1 = new _116.Solution1();
16+
solution2 = new _116.Solution2();
17+
}
1618

17-
@Test
18-
public void test1() {
19-
root = new TreeLinkNode(1);
20-
root.left = new TreeLinkNode(2);
21-
root.right = new TreeLinkNode(3);
22-
root.left.left = new TreeLinkNode(4);
23-
root.left.right = new TreeLinkNode(5);
24-
root.right.right = new TreeLinkNode(7);
19+
@Test
20+
public void test1() {
21+
root = new TreeLinkNode(1);
22+
root.left = new TreeLinkNode(2);
23+
root.right = new TreeLinkNode(3);
24+
root.left.left = new TreeLinkNode(4);
25+
root.left.right = new TreeLinkNode(5);
26+
root.right.right = new TreeLinkNode(7);
2527

26-
solution1.connect(root);
27-
}
28+
solution1.connect(root);
29+
}
30+
31+
@Test
32+
public void test2() {
33+
root = new TreeLinkNode(1);
34+
root.left = new TreeLinkNode(2);
35+
root.right = new TreeLinkNode(3);
36+
root.left.left = new TreeLinkNode(4);
37+
root.left.right = new TreeLinkNode(5);
38+
root.right.right = new TreeLinkNode(7);
39+
40+
solution2.connect(root);
41+
}
2842
}

0 commit comments

Comments
 (0)