forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1200Test.java
More file actions
41 lines (33 loc) · 1.03 KB
/
_1200Test.java
File metadata and controls
41 lines (33 loc) · 1.03 KB
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
35
36
37
38
39
40
41
package com.fishercoder;
import com.fishercoder.solutions._1200;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class _1200Test {
private static _1200.Solution1 solution1;
private static int[] arr;
private static List<List<Integer>> expected;
@BeforeClass
public static void setup() {
solution1 = new _1200.Solution1();
}
@Test
public void test1() {
arr = new int[]{4, 2, 1, 3};
expected = new ArrayList<>();
expected.add(Arrays.asList(1, 2));
expected.add(Arrays.asList(2, 3));
expected.add(Arrays.asList(3, 4));
assertEquals(expected, solution1.minimumAbsDifference(arr));
}
@Test
public void test2() {
arr = new int[]{40, 11, 26, 27, -20};
expected = new ArrayList<>();
expected.add(Arrays.asList(26, 27));
assertEquals(expected, solution1.minimumAbsDifference(arr));
}
}