Skip to content

Commit a669a01

Browse files
migrate 68 to junit5
1 parent e5aefb5 commit a669a01

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

Diff for: src/test/java/com/fishercoder/_68Test.java

+29-28
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
11
package com.fishercoder;
22

33
import com.fishercoder.solutions._68;
4+
import org.junit.jupiter.api.BeforeEach;
5+
import org.junit.jupiter.api.Test;
6+
47
import java.util.Arrays;
5-
import org.junit.BeforeClass;
6-
import org.junit.Test;
78

8-
import static org.junit.Assert.assertEquals;
9+
import static org.junit.jupiter.api.Assertions.assertEquals;
910

1011
public class _68Test {
11-
private static _68.Solution1 solution1;
12-
private static String[] words;
12+
private static _68.Solution1 solution1;
13+
private static String[] words;
1314

14-
@BeforeClass
15-
public static void setup() {
16-
solution1 = new _68.Solution1();
17-
}
15+
@BeforeEach
16+
public void setup() {
17+
solution1 = new _68.Solution1();
18+
}
1819

19-
@Test
20-
public void test1() {
21-
words =
22-
new String[] {"This", "is", "a", "good", "test!", "\n", "What", "do", "you", "\n", "think?",
23-
"\n", "I", "think", "so", "too!"};
24-
assertEquals(Arrays.asList(
25-
"This is a good",
26-
"test! \n What do",
27-
"you \n think? \n I",
28-
"think so too! "), solution1.fullJustify(words, 16));
29-
}
20+
@Test
21+
public void test1() {
22+
words =
23+
new String[]{"This", "is", "a", "good", "test!", "\n", "What", "do", "you", "\n", "think?",
24+
"\n", "I", "think", "so", "too!"};
25+
assertEquals(Arrays.asList(
26+
"This is a good",
27+
"test! \n What do",
28+
"you \n think? \n I",
29+
"think so too! "), solution1.fullJustify(words, 16));
30+
}
3031

31-
@Test
32-
public void test2() {
33-
words = new String[] {"This", "is", "an", "example", "of", "text", "justification."};
34-
assertEquals(Arrays.asList(
35-
"This is an",
36-
"example of text",
37-
"justification. "), solution1.fullJustify(words, 16));
38-
}
32+
@Test
33+
public void test2() {
34+
words = new String[]{"This", "is", "an", "example", "of", "text", "justification."};
35+
assertEquals(Arrays.asList(
36+
"This is an",
37+
"example of text",
38+
"justification. "), solution1.fullJustify(words, 16));
39+
}
3940
}

0 commit comments

Comments
 (0)