forked from exercism/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBobTest.java
More file actions
216 lines (186 loc) · 5.95 KB
/
BobTest.java
File metadata and controls
216 lines (186 loc) · 5.95 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.BeforeEach;
import static org.assertj.core.api.Assertions.assertThat;
public class BobTest {
private Bob bob;
@BeforeEach
public void setUp() {
bob = new Bob();
}
@Test
@DisplayName("stating something")
public void saySomething() {
assertThat(bob.hey("Tom-ay-to, tom-aaaah-to."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("shouting")
public void shouting() {
assertThat(bob.hey("WATCH OUT!"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("shouting gibberish")
public void shoutingGibberish() {
assertThat(bob.hey("FCECDFCAAB"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("asking a question")
public void askingAQuestion() {
assertThat(bob.hey("Does this cryogenic chamber make me look fat?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("asking a numeric question")
public void askingANumericQuestion() {
assertThat(bob.hey("You are, what, like 15?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("asking gibberish")
public void askingGibberish() {
assertThat(bob.hey("fffbbcbeab?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("talking forcefully")
public void talkingForcefully() {
assertThat(bob.hey("Hi there!"))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("using acronyms in regular speech")
public void usingAcronymsInRegularSpeech() {
assertThat(bob.hey("It's OK if you don't want to go work for NASA."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("forceful question")
public void forcefulQuestions() {
assertThat(bob.hey("WHAT'S GOING ON?"))
.isEqualTo("Calm down, I know what I'm doing!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("shouting numbers")
public void shoutingNumbers() {
assertThat(bob.hey("1, 2, 3 GO!"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("no letters")
public void onlyNumbers() {
assertThat(bob.hey("1, 2, 3"))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("question with no letters")
public void questionWithOnlyNumbers() {
assertThat(bob.hey("4?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("shouting with special characters")
public void shoutingWithSpecialCharacters() {
assertThat(bob.hey("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("shouting with no exclamation mark")
public void shoutingWithNoExclamationMark() {
assertThat(bob.hey("I HATE THE DENTIST"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("statement containing question mark")
public void statementContainingQuestionMark() {
assertThat(bob.hey("Ending with ? means a question."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("non-letters with question")
public void nonLettersWithQuestion() {
assertThat(bob.hey(":) ?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("prattling on")
public void prattlingOn() {
assertThat(bob.hey("Wait! Hang on. Are you going to be OK?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("silence")
public void silence() {
assertThat(bob.hey(""))
.isEqualTo("Fine. Be that way!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("prolonged silence")
public void prolongedSilence() {
assertThat(bob.hey(" "))
.isEqualTo("Fine. Be that way!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("alternate silence")
public void alternateSilence() {
assertThat(bob.hey("\t\t\t\t\t\t\t\t\t\t"))
.isEqualTo("Fine. Be that way!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("starting with whitespace")
public void startingWithWhitespace() {
assertThat(bob.hey(" hmmmmmmm..."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("ending with whitespace")
public void endingWithWhiteSpace() {
assertThat(bob.hey("Okay if like my spacebar quite a bit? "))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("other whitespace")
public void otherWhiteSpace() {
assertThat(bob.hey("\n\r \t"))
.isEqualTo("Fine. Be that way!");
}
@Disabled("Remove to run test")
@Test
@DisplayName("non-question ending with whitespace")
public void nonQuestionEndingWithWhiteSpace() {
assertThat(bob.hey("This is a statement ending with whitespace "))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
@DisplayName("multiple line question")
public void multipleLineQuestion() {
assertThat(bob.hey("\nDoes this cryogenic chamber make\n me look fat?"))
.isEqualTo("Sure.");
}
}