forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1133Test.java
More file actions
34 lines (27 loc) · 873 Bytes
/
_1133Test.java
File metadata and controls
34 lines (27 loc) · 873 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
31
32
33
34
package com.fishercoder;
import com.fishercoder.solutions._1133;
import org.junit.BeforeClass;
import org.junit.Test;
import static junit.framework.TestCase.assertEquals;
public class _1133Test {
private static _1133.Solution1 solution1;
private static _1133.Solution2 solution2;
private static int[] A;
@BeforeClass
public static void setup() {
solution1 = new _1133.Solution1();
solution2 = new _1133.Solution2();
}
@Test
public void test1() {
A = new int[]{5, 7, 3, 9, 4, 9, 8, 3, 1};
assertEquals(8, solution1.largestUniqueNumber(A));
assertEquals(8, solution2.largestUniqueNumber(A));
}
@Test
public void test2() {
A = new int[]{9, 9, 8, 8};
assertEquals(-1, solution1.largestUniqueNumber(A));
assertEquals(-1, solution2.largestUniqueNumber(A));
}
}