|
1 | 1 | package com.fishercoder;
|
2 | 2 |
|
3 | 3 | import com.fishercoder.solutions._973;
|
4 |
| -import org.junit.BeforeClass; |
5 |
| -import org.junit.Test; |
| 4 | +import org.junit.jupiter.api.BeforeEach; |
| 5 | +import org.junit.jupiter.api.Test; |
6 | 6 |
|
7 |
| -import static org.junit.Assert.assertArrayEquals; |
| 7 | +import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
8 | 8 |
|
9 | 9 | public class _973Test {
|
10 |
| - private static _973.Solution1 test; |
| 10 | + private static _973.Solution1 solution1; |
| 11 | + private static _973.Solution2 solution2; |
11 | 12 |
|
12 |
| - @BeforeClass |
13 |
| - public static void setUp() { |
14 |
| - test = new _973.Solution1(); |
| 13 | + @BeforeEach |
| 14 | + public void setUp() { |
| 15 | + solution1 = new _973.Solution1(); |
| 16 | + solution2 = new _973.Solution2(); |
15 | 17 | }
|
16 | 18 |
|
17 | 19 | @Test
|
18 | 20 | public void test1() {
|
19 |
| - assertArrayEquals(new int[][]{{-2, 2}}, test.kClosest(new int[][]{{1, 3}, {-2, 2}}, 1)); |
| 21 | + assertArrayEquals(new int[][]{{-2, 2}}, solution1.kClosest(new int[][]{{1, 3}, {-2, 2}}, 1)); |
| 22 | + assertArrayEquals(new int[][]{{-2, 2}}, solution2.kClosest(new int[][]{{1, 3}, {-2, 2}}, 1)); |
20 | 23 | }
|
21 | 24 |
|
22 | 25 | @Test
|
23 | 26 | public void test2() {
|
24 |
| - assertArrayEquals(new int[][]{{3, 3},{-2, 4}}, test.kClosest(new int[][]{{3, 3},{5, -1},{-2, 4}}, 2)); |
| 27 | + assertArrayEquals(new int[][]{{3, 3}, {-2, 4}}, solution1.kClosest(new int[][]{{3, 3}, {5, -1}, {-2, 4}}, 2)); |
| 28 | + assertArrayEquals(new int[][]{{-2, 4}, {3, 3}}, solution2.kClosest(new int[][]{{3, 3}, {5, -1}, {-2, 4}}, 2)); |
25 | 29 | }
|
26 | 30 | }
|
0 commit comments