|
3 | 3 | import com.fishercoder.common.classes.ListNode;
|
4 | 4 | import com.fishercoder.common.utils.LinkedListUtils;
|
5 | 5 | import com.fishercoder.solutions._83;
|
| 6 | +import org.junit.jupiter.api.BeforeEach; |
| 7 | +import org.junit.jupiter.api.Test; |
| 8 | + |
6 | 9 | import java.util.Arrays;
|
7 |
| -import org.junit.Assert; |
8 |
| -import org.junit.BeforeClass; |
9 |
| -import org.junit.Test; |
| 10 | + |
| 11 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
10 | 12 |
|
11 | 13 | /**
|
12 | 14 | * Created by fishercoder on 4/18/17.
|
13 | 15 | */
|
14 | 16 | public class _83Test {
|
15 | 17 |
|
16 |
| - private static _83.Solution1 solution1; |
17 |
| - private static _83.Solution2 solution2; |
18 |
| - private static ListNode head; |
19 |
| - private static ListNode expected; |
20 |
| - |
21 |
| - @BeforeClass |
22 |
| - public static void setup() { |
23 |
| - solution1 = new _83.Solution1(); |
24 |
| - solution2 = new _83.Solution2(); |
25 |
| - } |
26 |
| - |
27 |
| - @Test |
28 |
| - public void test1() { |
29 |
| - head = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 1, 2, 3, 3)); |
30 |
| - expected = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 2, 3)); |
31 |
| - Assert.assertEquals(expected, solution1.deleteDuplicates(head)); |
32 |
| - } |
33 |
| - |
34 |
| - @Test |
35 |
| - public void test2() { |
36 |
| - head = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 1, 2, 3, 3)); |
37 |
| - expected = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 2, 3)); |
38 |
| - Assert.assertEquals(expected, solution2.deleteDuplicates(head)); |
39 |
| - } |
| 18 | + private static _83.Solution1 solution1; |
| 19 | + private static _83.Solution2 solution2; |
| 20 | + private static ListNode head; |
| 21 | + private static ListNode expected; |
| 22 | + |
| 23 | + @BeforeEach |
| 24 | + public void setup() { |
| 25 | + solution1 = new _83.Solution1(); |
| 26 | + solution2 = new _83.Solution2(); |
| 27 | + } |
| 28 | + |
| 29 | + @Test |
| 30 | + public void test1() { |
| 31 | + head = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 1, 2, 3, 3)); |
| 32 | + expected = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 2, 3)); |
| 33 | + assertEquals(expected, solution1.deleteDuplicates(head)); |
| 34 | + } |
| 35 | + |
| 36 | + @Test |
| 37 | + public void test2() { |
| 38 | + head = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 1, 2, 3, 3)); |
| 39 | + expected = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 2, 3)); |
| 40 | + assertEquals(expected, solution2.deleteDuplicates(head)); |
| 41 | + } |
40 | 42 | }
|
0 commit comments