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 55import com .fishercoder .common .utils .TreeUtils ;
66import com .fishercoder .solutions ._2007 ;
77import 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 ;
1010
1111import java .util .Arrays ;
1212
13- import static org .junit .Assert .assertEquals ;
13+ import static org .junit .jupiter . api . Assertions .assertEquals ;
1414
1515public class _222Test {
1616 private static _222 .Solution1 solution1 ;
1717 private static _222 .Solution2 solution2 ;
1818 private static int expected ;
1919 private static TreeNode root ;
2020
21- @ BeforeClass
22- public static void setup () {
21+ @ BeforeEach
22+ public void setup () {
2323 solution1 = new _222 .Solution1 ();
2424 solution2 = new _222 .Solution2 ();
2525 }
@@ -42,4 +42,13 @@ public void test2() {
4242 assertEquals (expected , solution2 .countNodes (root ));
4343 }
4444
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+
4554}
You can’t perform that action at this time.
0 commit comments