Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9335941

Browse files
committed
add new file test
1 parent 2005a9b commit 9335941

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.swe102x.mytest;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
import org.junit.jupiter.api.AfterAll;
6+
import org.junit.jupiter.api.AfterEach;
7+
import org.junit.jupiter.api.BeforeAll;
8+
import org.junit.jupiter.api.BeforeEach;
9+
import org.junit.jupiter.api.Test;
10+
11+
import com.swe102x.myclass.FirstCommonAncestor;
12+
import com.swe102x.myclass.FirstCommonAncestor.TreeNode;
13+
14+
class FirstCommonAncestorTest {
15+
16+
@BeforeAll
17+
static void setUpBeforeClass() throws Exception {
18+
}
19+
20+
@AfterAll
21+
static void tearDownAfterClass() throws Exception {
22+
}
23+
FirstCommonAncestor ancestor;
24+
FirstCommonAncestor.TreeNode root;
25+
@BeforeEach
26+
void setUp() throws Exception {
27+
28+
ancestor = new FirstCommonAncestor();
29+
root = ancestor.new TreeNode(4);
30+
ancestor.addNode(root);
31+
32+
}
33+
34+
@AfterEach
35+
void tearDown() throws Exception {
36+
}
37+
38+
@Test
39+
void testFindFCA() {
40+
//test case
41+
assertEquals(null, ancestor.findFCA(null, root.getLeft().getLeft().getLeft(), root.getRight().getRight()));
42+
}
43+
44+
}

0 commit comments

Comments
 (0)