Skip to content

Commit 2980913

Browse files
migrate 83 to junit5
1 parent bd80c26 commit 2980913

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

src/test/java/com/fishercoder/_83Test.java

+29-27
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,40 @@
33
import com.fishercoder.common.classes.ListNode;
44
import com.fishercoder.common.utils.LinkedListUtils;
55
import com.fishercoder.solutions._83;
6+
import org.junit.jupiter.api.BeforeEach;
7+
import org.junit.jupiter.api.Test;
8+
69
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;
1012

1113
/**
1214
* Created by fishercoder on 4/18/17.
1315
*/
1416
public class _83Test {
1517

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+
}
4042
}

0 commit comments

Comments
 (0)