1
1
package com .fishercoder ;
2
2
3
3
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 ;
6
6
7
7
import java .util .ArrayList ;
8
8
import java .util .Arrays ;
9
9
import java .util .List ;
10
10
11
- import static org .assertj . core .api .Assertions .assertThat ;
11
+ import static org .junit . jupiter .api .Assertions .assertEquals ;
12
12
13
13
public class _17Test {
14
14
private static _17 .Solution1 solution1 ;
@@ -17,8 +17,8 @@ public class _17Test {
17
17
private static String digits ;
18
18
private static List <String > expected ;
19
19
20
- @ BeforeClass
21
- public static void setup () {
20
+ @ BeforeEach
21
+ public void setup () {
22
22
solution1 = new _17 .Solution1 ();
23
23
solution2 = new _17 .Solution2 ();
24
24
solution3 = new _17 .Solution3 ();
@@ -28,17 +28,17 @@ public static void setup() {
28
28
public void test1 () {
29
29
digits = "2" ;
30
30
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 ));
34
34
}
35
35
36
36
@ Test
37
37
public void test2 () {
38
38
digits = "23" ;
39
39
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 ));
43
43
}
44
44
}
0 commit comments