8000 migrate _41 to junit 5 · aav789/Leetcode@c242276 · GitHub
[go: up one dir, main page]

Skip to content

Commit c242276

Browse files
migrate _41 to junit 5
1 parent ccd0b30 commit c242276

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
package com.fishercoder;
22

33
import com.fishercoder.solutions._41;
4-
import org.junit.BeforeClass;
5-
import org.junit.Test;
4+
import org.junit.jupiter.api.BeforeEach;
5+
import org.junit.jupiter.api.Test;
66

7-
import static org.junit.Assert.assertEquals;
7+
import static org.junit.jupiter.api.Assertions.assertEquals;
88

99
public class _41Test {
10-
private static _41.Solution1 solution1;
11-
private static int[] nums;
12-
13-
@BeforeClass
14-
public static void setup() {
15-
solution1 = new _41.Solution1();
16-
}
17-
18-
@Test
19-
public void test1() {
20-
nums = new int[] {1, 2, 0};
21-
assertEquals(3, solution1.firstMissingPositive(nums));
22-
}
23-
24-
@Test
25-
public void test2() {
26-
nums = new int[] {};
27-
assertEquals(1, solution1.firstMissingPositive(nums));
28-
}
29-
30-
@Test
31-
public void test3() {
32-
nums = new int[] {3, 4, -1, 1};
33-
assertEquals(2, solution1.firstMissingPositive(nums));
34-
}
35-
36-
@Test
37-
public void test4() {
38-
nums = new int[] {2};
39-
assertEquals(1, solution1.firstMissingPositive(nums));
40-
}
10+
private static _41.Solution1 solution1;
11+
private static int[] nums;
12+
13+
@BeforeEach
14+
public void setup() {
15+
solution1 = new _41.Solution1();
16+
}
17+
18+
@Test
19+
public void test1() {
20+
nums = new int[]{1, 2, 0};
21+
assertEquals(3, solution1.firstMissingPositive(nums));
22+
}
23+
24+
@Test
25+
public void test2() {
26+
nums = new int[]{};
27+
assertEquals(1, solution1.firstMissingPositive(nums));
28+
}
29+
30+
@Test
31+
public void test3() {
32+
nums = new int[]{3, 4, -1, 1};
33+
assertEquals(2, solution1.firstMissingPositive(nums));
34+
}
35+
36+
@Test
37+
public void test4() {
38+
nums = new int[]{2};
39+
assertEquals(1, solution1.firstMissingPositive(nums));
40+
}
4141
}

0 commit comments

Comments
 (0)
0