File tree 1 file changed +13
-3
lines changed
src/test/java/com/fishercoder
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ public class _538Test {
14
14
private static TreeNode expectedRoot ;
15
15
private static TreeNode root ;
16
16
17
- @ BeforeClass
18
- public static void setup () {
17
+ @ Before
18
+ public void setup () {
19
19
solution1 = new _538 .Solution1 ();
20
20
solution2 = new _538 .Solution2 ();
21
21
}
@@ -29,11 +29,21 @@ public void test1() {
29
29
expectedRoot .left = new TreeNode (20 );
30
30
expectedRoot .right = new TreeNode (13 );
31
31
assertEquals (expectedRoot .toString (), solution1 .convertBST (root ).toString ());
32
- assertEquals (expectedRoot .toString (), solution2 .convertBST (root ).toString ());
33
32
}
34
33
35
34
@ Test
36
35
public void test2 () {
36
+ root = new TreeNode (5 );
37
+ root .left = new TreeNode (2 );
38
+ root .right = new TreeNode (13 );
39
+ expectedRoot = new TreeNode (18 );
40
+ expectedRoot .left = new TreeNode (20 );
41
+ expectedRoot .right = new TreeNode (13 );
42
+ assertEquals (expectedRoot .toString (), solution2 .convertBST (root ).toString ());
43
+ }
44
+
45
+ @ Test
46
+ public void test3 () {
37
47
root = null ;
38
48
expectedRoot = null ;
39
49
assertEquals (expectedRoot , solution1 .convertBST (root ));
You can’t perform that action at this time.
0 commit comments