|
7 | 7 |
|
8 | 8 | import static org.junit.Assert.assertEquals;
|
9 | 9 |
|
10 |
| -/** |
11 |
| - * Created by stevesun on 5/29/17. |
12 |
| - */ |
13 | 10 | public class _328Test {
|
14 |
| - private static _328 test; |
15 |
| - private static ListNode expected; |
16 |
| - private static ListNode node; |
| 11 | + private static _328.Solution1 solution1; |
| 12 | + private static ListNode expected; |
| 13 | + private static ListNode node; |
17 | 14 |
|
18 |
| - @BeforeClass |
19 |
| - public static void setup() { |
20 |
| - test = new _328(); |
21 |
| - } |
| 15 | + @BeforeClass |
| 16 | + public static void setup() { |
| 17 | + solution1 = new _328.Solution1(); |
| 18 | + } |
22 | 19 |
|
23 |
| - @Test |
24 |
| - public void test1() { |
25 |
| - node = new ListNode(1); |
26 |
| - node.next = new ListNode(2); |
27 |
| - node.next.next = new ListNode(3); |
28 |
| - node.next.next.next = new ListNode(4); |
29 |
| - node.next.next.next.next = new ListNode(5); |
| 20 | + @Test |
| 21 | + public void test1() { |
| 22 | + node = new ListNode(1); |
| 23 | + node.next = new ListNode(2); |
| 24 | + node.next.next = new ListNode(3); |
| 25 | + node.next.next.next = new ListNode(4); |
| 26 | + node.next.next.next.next = new ListNode(5); |
30 | 27 |
|
31 |
| - expected = new ListNode(1); |
32 |
| - expected.next = new ListNode(3); |
33 |
| - expected.next.next = new ListNode(5); |
34 |
| - expected.next.next.next = new ListNode(2); |
35 |
| - expected.next.next.next.next = new ListNode(4); |
36 |
| - assertEquals(expected, test.oddEvenList(node)); |
37 |
| - } |
| 28 | + expected = new ListNode(1); |
| 29 | + expected.next = new ListNode(3); |
| 30 | + expected.next.next = new ListNode(5); |
| 31 | + expected.next.next.next = new ListNode(2); |
| 32 | + expected.next.next.next.next = new ListNode(4); |
| 33 | + assertEquals(expected, solution1.oddEvenList(node)); |
| 34 | + } |
38 | 35 | }
|
0 commit comments