|
1 | 1 | import org.junit.Test;
|
2 | 2 | import org.junit.Ignore;
|
3 | 3 |
|
4 |
| -import static org.junit.Assert.assertEquals; |
| 4 | +import static org.assertj.core.api.Assertions.*; |
5 | 5 |
|
6 | 6 | public class SayTest {
|
7 | 7 |
|
8 | 8 | private Say say = new Say();
|
9 | 9 |
|
10 | 10 | @Test
|
11 | 11 | public void zero() {
|
12 |
| - assertEquals("zero", say.say(0)); |
| 12 | + assertThat(say.say(0)).isEqualTo("zero"); |
13 | 13 | }
|
14 | 14 |
|
15 | 15 | @Ignore("Remove to run test")
|
16 | 16 | @Test
|
17 | 17 | public void one() {
|
18 |
| - assertEquals("one", say.say(1)); |
| 18 | + assertThat(say.say(1)).isEqualTo("one"); |
19 | 19 | }
|
20 | 20 |
|
21 | 21 | @Ignore("Remove to run test")
|
22 | 22 | @Test
|
23 | 23 | public void fourteen() {
|
24 |
| - assertEquals("fourteen", say.say(14)); |
| 24 | + assertThat(say.say(14)).isEqualTo("fourteen"); |
25 | 25 | }
|
26 | 26 |
|
27 | 27 | @Ignore("Remove to run test")
|
28 | 28 | @Test
|
29 | 29 | public void twenty() {
|
30 |
| - assertEquals("twenty", say.say(20)); |
| 30 | + assertThat(say.say(20)).isEqualTo("twenty"); |
31 | 31 | }
|
32 | 32 |
|
33 | 33 | @Ignore("Remove to run test")
|
34 | 34 | @Test
|
35 | 35 | public void twentyTwo() {
|
36 |
| - assertEquals("twenty-two", say.say(22)); |
| 36 | + assertThat(say.say(22)).isEqualTo("twenty-two"); |
37 | 37 | }
|
38 | 38 |
|
39 | 39 | @Ignore("Remove to run test")
|
40 | 40 | @Test
|
41 | 41 | public void oneHundred() {
|
42 |
| - assertEquals("one hundred", say.say(100)); |
| 42 | + assertThat(say.say(100)).isEqualTo("one hundred"); |
43 | 43 | }
|
44 | 44 |
|
45 | 45 | @Ignore("Remove to run test")
|
46 | 46 | @Test
|
47 | 47 | public void oneHundredTwentyThree() {
|
48 |
| - assertEquals("one hundred twenty-three", say.say(123)); |
| 48 | + assertThat(say.say(123)).isEqualTo("one hundred twenty-three"); |
49 | 49 | }
|
50 | 50 |
|
51 | 51 | @Ignore("Remove to run test")
|
52 | 52 | @Test
|
53 | 53 | public void oneThousand() {
|
54 |
| - assertEquals("one thousand", say.say(1_000)); |
| 54 | + assertThat(say.say(1_000)).isEqualTo("one thousand"); |
55 | 55 | }
|
56 | 56 |
|
57 | 57 | @Ignore("Remove to run test")
|
58 | 58 | @Test
|
59 | 59 | public void oneThousandTwoHundredThirtyFour() {
|
60 |
| - assertEquals("one thousand two hundred thirty-four", say.say(1_234)); |
| 60 | + assertThat(say.say(1_234)).isEqualTo("one thousand two hundred thirty-four"); |
61 | 61 | }
|
62 | 62 |
|
63 | 63 | @Ignore("Remove to run test")
|
64 | 64 | @Test
|
65 | 65 | public void oneMillion() {
|
66 |
| - assertEquals("one million", say.say(1_000_000)); |
| 66 | + assertThat(say.say(1_000_000)).isEqualTo("one million"); |
67 | 67 | }
|
68 | 68 |
|
69 | 69 | @Ignore("Remove to run test")
|
70 | 70 | @Test
|
71 | 71 | public void oneMillionTwoThousandThreeHundredFortyFive() {
|
72 |
| - assertEquals("one million two thousand three hundred forty-five", say.say(1_002_345)); |
| 72 | + assertThat(say.say(1_002_345)).isEqualTo("one million two thousand three hundred forty-five"); |
73 | 73 | }
|
74 | 74 |
|
75 | 75 | @Ignore("Remove to run test")
|
76 | 76 | @Test
|
77 | 77 | public void oneBillion() {
|
78 |
| - assertEquals("one billion", say.say(1_000_000_000)); |
| 78 | + assertThat(say.say(1_000_000_000)).isEqualTo("one billion"); |
79 | 79 | }
|
80 | 80 |
|
81 | 81 | @Ignore("Remove to run test")
|
82 | 82 | @Test
|
83 | 83 | public void nineHundredEightySevenBillionSixHundredFiftyFourThreeHundredTwentyOneThousandOneHundredTwentyThree() {
|
84 |
| - assertEquals("nine hundred eighty-seven billion six hundred fifty-four million" + |
85 |
| - " three hundred twenty-one thousand one hundred twenty-three", say.say(987_654_321_123L)); |
| 84 | + assertThat(say.say(987_654_321_123L)) |
| 85 | + .isEqualTo("nine hundred eighty-seven billion six hundred fifty-four million" + |
| 86 | + " three hundred twenty-one thousand one hundred twenty-three"); |
86 | 87 | }
|
87 | 88 |
|
88 | 89 | @Ignore("Remove to run test")
|
|
0 commit comments