8000 migrate 17 test to use Junit5 · githubniraj/Leetcode@2354d10 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2354d10

Browse files
migrate 17 test to use Junit5
1 parent 4f9ee81 commit 2354d10

File tree

1 file changed

+11
-11
lines changed

1 file changed

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

33
import com.fishercoder.solutions._17;
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

77
import java.util.ArrayList;
88
import java.util.Arrays;
99
import java.util.List;
1010

11-
import static org.assertj.core.api.Assertions.assertThat;
11+
import static org.junit.jupiter.api.Assertions.assertEquals;
1212

1313
public class _17Test {
1414
private static _17.Solution1 solution1;
@@ -17,8 +17,8 @@ public class _17Test {
1717
private static String digits;
1818
private static List<String> expected;
1919

20-
@BeforeClass
21-
public static void setup() {
20+
@BeforeEach
21+
public void setup() {
2222
solution1 = new _17.Solution1();
2323
solution2 = new _17.Solution2();
2424
solution3 = new _17.Solution3();
@@ -28,17 +28,17 @@ public static void setup() {
2828
public void test1() {
2929
digits = "2";
3030
expected = new ArrayList<>(Arrays.asList("a", "b", "c"));
31-
assertThat(expected).hasSameElementsAs(solution1.letterCombinations(digits));
32-
assertThat(expected).hasSameElementsAs(solution2.letterCombinations(digits));
33-
assertThat(expected).hasSameElementsAs(solution3.letterCombinations(digits));
31+
assertEquals(expected, solution1.letterCombinations(digits));
32+
assertEquals(expected, solution2.letterCombinations(digits));
33+
assertEquals(expected, solution3.letterCombinations(digits));
3434
}
3535

3636
@Test
3737
public void test2() {
3838
digits = "23";
3939
expected = new ArrayList<>(Arrays.asList("ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"));
40-
assertThat(expected).hasSameElementsAs(solution1.letterCombinations(digits));
41-
assertThat(expected).hasSameElementsAs(solution2.letterCombinations(digits));
42-
assertThat(expected).hasSameElementsAs(solution3.letterCombinations(digits));
40+
assertEquals(expected, solution1.letterCombinations(digits));
41+
assertEquals(expected, solution2.letterCombinations(digits));
42+
assertEquals(expected, solution3.letterCombinations(digits));
4343
}
4444
}

0 commit comments

Comments
 (0)
0