|
1 | 1 | package com.fishercoder;
|
2 | 2 |
|
3 | 3 | import com.fishercoder.solutions._68;
|
| 4 | +import org.junit.jupiter.api.BeforeEach; |
| 5 | +import org.junit.jupiter.api.Test; |
| 6 | + |
4 | 7 | import java.util.Arrays;
|
5 |
| -import org.junit.BeforeClass; |
6 |
| -import org.junit.Test; |
7 | 8 |
|
8 |
| -import static org.junit.Assert.assertEquals; |
| 9 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
9 | 10 |
|
10 | 11 | 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; |
13 | 14 |
|
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 | + } |
18 | 19 |
|
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 | + } |
30 | 31 |
|
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 | + } |
39 | 40 | }
|
0 commit comments