/
_61Test.java
40 lines (33 loc) · 1.11 KB
/
_61Test.java
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
package com.fishercoder;
import com.fishercoder.common.classes.ListNode;
import com.fishercoder.solutions._61;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class _61Test {
private static _61.Solution1 solution1;
private static ListNode expected;
private static ListNode actual;
private static ListNode head;
private static int k;
@BeforeEach
public void setup() {
solution1 = new _61.Solution1();
}
@Test
public void test1() {
k = 2;
expected = new ListNode(4);
expected.next = new ListNode(5);
expected.next.next = new ListNode(1);
expected.next.next.next = new ListNode(2);
expected.next.next.next.next = new ListNode(3);
head = new ListNode(1);
head.next = new ListNode(2);
head.next.next = new ListNode(3);
head.next.next.next = new ListNode(4);
head.next.next.next.next = new ListNode(5);
actual = solution1.rotateRight(head, k);
assertEquals(expected, actual);
}
}