Skip to content

Commit

Permalink
migrate 61 to junit5
Browse files Browse the repository at this point in the history
  • Loading branch information
fishercoder1534 committed Feb 28, 2024
1 parent 7d53495 commit 1473117
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/test/java/com/fishercoder/_61Test.java
Expand Up @@ -2,39 +2,39 @@

import com.fishercoder.common.classes.ListNode;
import com.fishercoder.solutions._61;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static junit.framework.Assert.assertEquals;
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;
private static _61.Solution1 solution1;
private static ListNode expected;
private static ListNode actual;
private static ListNode head;
private static int k;

@BeforeClass
public static void setup() {
solution1 = new _61.Solution1();
}
@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);
@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);
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);
}
actual = solution1.rotateRight(head, k);
assertEquals(expected, actual);
}
}

0 comments on commit 1473117

Please sign in to comment.