Skip to content

Commit 7205330

Browse files
add test for 92
1 parent 3c7a2a6 commit 7205330

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.common.classes.ListNode;
4+
import com.fishercoder.solutions._92;
5+
import org.junit.BeforeClass;
6+
import org.junit.Test;
7+
8+
import java.util.Arrays;
9+
10+
import static org.junit.Assert.assertEquals;
11+
12+
public class _92Test {
13+
private static _92.Solution1 solution1;
14+
private static ListNode head;
15+
private static ListNode expected;
16+
17+
@BeforeClass
18+
public static void setup() {
19+
solution1 = new _92.Solution1();
20+
}
21+
22+
@Test
23+
public void test1() {
24+
head = ListNode.createSinglyLinkedList(Arrays.asList(1, 2, 3, 4, 5));
25+
expected = ListNode.createSinglyLinkedList(Arrays.asList(1, 4, 3, 2, 5));
26+
assertEquals(expected, solution1.reverseBetween(head, 2, 4));
27+
}
28+
29+
}

0 commit comments

Comments
 (0)