forked from jieli4970/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
30 lines (20 loc) · 562 Bytes
/
Test.java
File metadata and controls
30 lines (20 loc) · 562 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import org.junit.Assert;
public class Test {
private final int[] nums = {-2, -1, 0, 1, 2};
private final int expect = 2;
@org.junit.Test
public void ThreeSumTest() {
test(new ThreeSumSlow());
}
@org.junit.Test
public void ThreeSumBinarySearchTest() {
test(new ThreeSumBinarySearch());
}
@org.junit.Test
public void TreeSumTwoPointerTest() {
test(new ThreeSumTwoPointer());
}
private void test(ThreeSum threeSum) {
Assert.assertEquals(threeSum.count(nums), expect);
}
}