forked from exercism/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSayTest.java
More file actions
100 lines (82 loc) · 2.62 KB
/
Copy pathSayTest.java
File metadata and controls
100 lines (82 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import org.junit.Test;
import org.junit.Ignore;
import static org.assertj.core.api.Assertions.*;
public class SayTest {
private Say say = new Say();
@Test
public void zero() {
assertThat(say.say(0)).isEqualTo("zero");
}
@Ignore("Remove to run test")
@Test
public void one() {
assertThat(say.say(1)).isEqualTo("one");
}
@Ignore("Remove to run test")
@Test
public void fourteen() {
assertThat(say.say(14)).isEqualTo("fourteen");
}
@Ignore("Remove to run test")
@Test
public void twenty() {
assertThat(say.say(20)).isEqualTo("twenty");
}
@Ignore("Remove to run test")
@Test
public void twentyTwo() {
assertThat(say.say(22)).isEqualTo("twenty-two");
}
@Ignore("Remove to run test")
@Test
public void oneHundred() {
assertThat(say.say(100)).isEqualTo("one hundred");
}
@Ignore("Remove to run test")
@Test
public void oneHundredTwentyThree() {
assertThat(say.say(123)).isEqualTo("one hundred twenty-three");
}
@Ignore("Remove to run test")
@Test
public void oneThousand() {
assertThat(say.say(1_000)).isEqualTo("one thousand");
}
@Ignore("Remove to run test")
@Test
public void oneThousandTwoHundredThirtyFour() {
assertThat(say.say(1_234)).isEqualTo("one thousand two hundred thirty-four");
}
@Ignore("Remove to run test")
@Test
public void oneMillion() {
assertThat(say.say(1_000_000)).isEqualTo("one million");
}
@Ignore("Remove to run test")
@Test
public void oneMillionTwoThousandThreeHundredFortyFive() {
assertThat(say.say(1_002_345)).isEqualTo("one million two thousand three hundred forty-five");
}
@Ignore("Remove to run test")
@Test
public void oneBillion() {
assertThat(say.say(1_000_000_000)).isEqualTo("one billion");
}
@Ignore("Remove to run test")
@Test
public void nineHundredEightySevenBillionSixHundredFiftyFourThreeHundredTwentyOneThousandOneHundredTwentyThree() {
assertThat(say.say(987_654_321_123L))
.isEqualTo("nine hundred eighty-seven billion six hundred fifty-four million" +
" three hundred twenty-one thousand one hundred twenty-three");
}
@Ignore("Remove to run test")
@Test(expected = IllegalArgumentException.class)
public void illegalNegativeNumber() {
say.say(-1);
}
@Ignore("Remove to run test")
@Test(expected = IllegalArgumentException.class)
public void illegalTooBigNumber() {
say.say(1_000_000_000_000L);
}
}