File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
src/test/java/com/fishercoder Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 5
5
import com .fishercoder .common .utils .TreeUtils ;
6
6
import com .fishercoder .solutions ._2007 ;
7
7
import com .fishercoder .solutions ._222 ;
8
- import org .junit .BeforeClass ;
9
- import org .junit .Test ;
8
+ import org .junit .jupiter . api . BeforeEach ;
9
+ import org .junit .jupiter . api . Test ;
10
10
11
11
import java .util .Arrays ;
12
12
13
- import static org .junit .Assert .assertEquals ;
13
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
14
14
15
15
public class _222Test {
16
16
private static _222 .Solution1 solution1 ;
17
17
private static _222 .Solution2 solution2 ;
18
18
private static int expected ;
19
19
private static TreeNode root ;
20
20
21
- @ BeforeClass
22
- public static void setup () {
21
+ @ BeforeEach
22
+ public void setup () {
23
23
solution1 = new _222 .Solution1 ();
24
24
solution2 = new _222 .Solution2 ();
25
25
}
@@ -42,4 +42,13 @@ public void test2() {
42
42
assertEquals (expected , solution2 .countNodes (root ));
43
43
}
44
44
45
+ @ Test
46
+ public void test3 () {
47
+ root = TreeUtils .constructBinaryTree (Arrays .asList ());
48
+ TreeUtils .printBinaryTree (root );
49
+ expected = 3 ;
50
+ assertEquals (expected , solution1 .countNodes (root ));
51
+ assertEquals (expected , solution2 .countNodes (root ));
52
+ }
53
+
45
54
}
You can’t perform that action at this time.
0 commit comments