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
190 lines (160 loc) · 4.9 KB
/
BobTest.java
File metadata and controls
190 lines (160 loc) · 4.9 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
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
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
public void saySomething() {
assertThat(bob.hey("Tom-ay-to, tom-aaaah-to."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
public void shouting() {
assertThat(bob.hey("WATCH OUT!"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
public void shoutingGibberish() {
assertThat(bob.hey("FCECDFCAAB"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
public void askingAQuestion() {
assertThat(bob.hey("Does this cryogenic chamber make me look fat?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
public void askingANumericQuestion() {
assertThat(bob.hey("You are, what, like 15?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
public void askingGibberish() {
assertThat(bob.hey("fffbbcbeab?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
public void talkingForcefully() {
assertThat(bob.hey("Hi there!"))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
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
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
public void shoutingNumbers() {
assertThat(bob.hey("1, 2, 3 GO!"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
public void onlyNumbers() {
assertThat(bob.hey("1, 2, 3"))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
public void questionWithOnlyNumbers() {
assertThat(bob.hey("4?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
public void shoutingWithSpecialCharacters() {
assertThat(bob.hey("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
public void shoutingWithNoExclamationMark() {
assertThat(bob.hey("I HATE THE DENTIST"))
.isEqualTo("Whoa, chill out!");
}
@Disabled("Remove to run test")
@Test
public void statementContainingQuestionMark() {
assertThat(bob.hey("Ending with ? means a question."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
public void nonLettersWithQuestion() {
assertThat(bob.hey(":) ?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
public void prattlingOn() {
assertThat(bob.hey("Wait! Hang on. Are you going to be OK?"))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
public void silence() {
assertThat(bob.hey(""))
.isEqualTo("Fine. Be that way!");
}
@Disabled("Remove to run test")
@Test
public void prolongedSilence() {
assertThat(bob.hey(" "))
.isEqualTo("Fine. Be that way!");
}
@Disabled("Remove to run test")
@Test
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
public void multipleLineQuestion() {
assertThat(bob.hey("\nDoes this cryogenic chamber make me look fat?\nNo."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
public void startingWithWhitespace() {
assertThat(bob.hey(" hmmmmmmm..."))
.isEqualTo("Whatever.");
}
@Disabled("Remove to run test")
@Test
public void endingWithWhiteSpace() {
assertThat(bob.hey("Okay if like my spacebar quite a bit? "))
.isEqualTo("Sure.");
}
@Disabled("Remove to run test")
@Test
public void otherWhiteSpace() {
assertThat(bob.hey("\n\r \t"))
.isEqualTo("Fine. Be that way!");
}
@Disabled("Remove to run test")
@Test
public void nonQuestionEndingWithWhiteSpace() {
assertThat(bob.hey("This is a statement ending with whitespace "))
.isEqualTo("Whatever.");
}
}