Skip to content

Commit 3bb6e8a

Browse files
fix tests for 298
1 parent c3fc701 commit 3bb6e8a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/test/java/com/fishercoder/_298Test.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.fishercoder.common.classes.TreeNode;
44
import com.fishercoder.common.utils.TreeUtils;
55
import com.fishercoder.solutions._298;
6-
import org.junit.BeforeClass;
76
import org.junit.Test;
87

98
import java.util.Arrays;
@@ -14,28 +13,29 @@ public class _298Test {
1413
private static _298.Solution1 solution1;
1514
private static _298.Solution2 solution2;
1615

17-
@BeforeClass
18-
public static void setup() {
19-
solution1 = new _298.Solution1();
20-
solution2 = new _298.Solution2();
21-
}
22-
2316
@Test
2417
public void test1() {
18+
solution1 = new _298.Solution1();
19+
solution2 = new _298.Solution2();
2520
TreeNode root = TreeUtils.constructBinaryTree(Arrays.asList(1, null, 3, 2, 4, null, null, null, 5));
2621
assertEquals(3, solution1.longestConsecutive(root));
2722
assertEquals(3, solution2.longestConsecutive(root));
2823
}
2924

3025
@Test
3126
public void test2() {
27+
solution1 = new _298.Solution1();
28+
solution2 = new _298.Solution2();
3229
TreeNode root = TreeUtils.constructBinaryTree(Arrays.asList(2, null, 3, 2, null, 1));
30+
TreeUtils.printBinaryTree(root);
3331
assertEquals(2, solution1.longestConsecutive(root));
3432
assertEquals(2, solution2.longestConsecutive(root));
3533
}
3634

3735
@Test
3836
public void test3() {
37+
solution1 = new _298.Solution1();
38+
solution2 = new _298.Solution2();
3939
TreeNode root = TreeUtils.constructBinaryTree(Arrays.asList(1, 2, 3, null, null, 4, 4, null, 5, null, null, 6));
4040
TreeUtils.printBinaryTree(root);
4141
assertEquals(4, solution1.longestConsecutive(root));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy