|
|
@@ -189,6 +189,19 @@ public class BowlingTest {
|
|
189
|
189
|
|
|
190
|
190
|
@Ignore("Remove to run test")
|
|
191
|
191
|
@Test
|
|
|
192
|
+ public void bonusRollAfterAStrikeInTheLastFrameCanNotScoreMoreThan10Points() {
|
|
|
193
|
+ int[] rolls = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11};
|
|
|
194
|
+
|
|
|
195
|
+ playGame(rolls);
|
|
|
196
|
+
|
|
|
197
|
+ expectedException.expect(IllegalStateException.class);
|
|
|
198
|
+ expectedException.expectMessage("Pin count exceeds pins on the lane");
|
|
|
199
|
+
|
|
|
200
|
+ game.score();
|
|
|
201
|
+ }
|
|
|
202
|
+
|
|
|
203
|
+ @Ignore("Remove to run test")
|
|
|
204
|
+ @Test
|
|
192
|
205
|
public void twoBonusRollsAfterAStrikeInTheLastFrameCanNotScoreMoreThan10Points() {
|
|
193
|
206
|
int[] rolls = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5, 6};
|
|
194
|
207
|
|
|
|
@@ -209,7 +222,33 @@ public class BowlingTest {
|
|
209
|
222
|
|
|
210
|
223
|
assertEquals(26, game.score());
|
|
211
|
224
|
}
|
|
|
225
|
+
|
|
|
226
|
+ @Ignore("Remove to run test")
|
|
|
227
|
+ @Test
|
|
|
228
|
+ public void theSecondBonusRollsAfterAStrikeInTheLastFrameCanNotBeAStrikeIfTheFirstOneIsNotAStrike() {
|
|
|
229
|
+ int[] rolls = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 6, 10};
|
|
212
|
230
|
|
|
|
231
|
+ playGame(rolls);
|
|
|
232
|
+
|
|
|
233
|
+ expectedException.expect(IllegalStateException.class);
|
|
|
234
|
+ expectedException.expectMessage("Pin count exceeds pins on the lane");
|
|
|
235
|
+
|
|
|
236
|
+ game.score();
|
|
|
237
|
+ }
|
|
|
238
|
+
|
|
|
239
|
+ @Ignore("Remove to run test")
|
|
|
240
|
+ @Test
|
|
|
241
|
+ public void secondBonusRollAfterAStrikeInTheLastFrameCanNotScoreMoreThan10Points() {
|
|
|
242
|
+ int[] rolls = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 11};
|
|
|
243
|
+
|
|
|
244
|
+ playGame(rolls);
|
|
|
245
|
+
|
|
|
246
|
+ expectedException.expect(IllegalStateException.class);
|
|
|
247
|
+ expectedException.expectMessage("Pin count exceeds pins on the lane");
|
|
|
248
|
+
|
|
|
249
|
+ game.score();
|
|
|
250
|
+ }
|
|
|
251
|
+
|
|
213
|
252
|
@Ignore("Remove to run test")
|
|
214
|
253
|
@Test
|
|
215
|
254
|
public void anUnstartedGameCanNotBeScored() {
|
|
|
@@ -238,7 +277,7 @@ public class BowlingTest {
|
|
238
|
277
|
|
|
239
|
278
|
@Ignore("Remove to run test")
|
|
240
|
279
|
@Test
|
|
241
|
|
- public void aGameWithMoreThanTenFramesCanNotBeScored() {
|
|
|
280
|
+ public void canNotRollIfGameAlreadyHasTenFrames() {
|
|
242
|
281
|
int[] rolls = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
|
243
|
282
|
|
|
244
|
283
|
playGame(rolls);
|