With the code for strikes written, it's time to run the acceptance tests to see if they agree that we are done.
There are only a handful of failures and two of them are about spares - which we have not implemented yet.
When I investigate the cause of the first failure I notice that the test for 12 strikes is only rolling 10 strikes:
@Test
public void twelveStrikesScoresThreeHundred() {
for(int frame = 0; frame < 10; frame++) {
deliverBall(10);
}
assertThat(scoreForFrame(10), is("300"));
}
No harm done though. I fix the test; it passes and I move on.
The other strike-related failure,
tenthFrameHasThreeBallsIfStrikeIsScored fails with
java.lang.AssertionError: thirdBallInFrame is not implemented yet
at org.junit.Assert.fail(Assert.java:69)
at bowling.acceptance.SingleGameScoring.notImplementedYet(SingleGameScoring.java:304)
at bowling.acceptance.SingleGameScoring.thirdBallInFrame(SingleGameScoring.java:289)
at bowling.acceptance.SingleGameScoring.tenthFrameHasThreeBallsIfStrikeIsScored(SingleGameScoring.java:259)
and after I hook up thirdBallInFrame, that test passes too.
Cool! On to spares...
Posted by Kevin Lawrence at March 20, 2007 04:50 PM
TrackBack URL for this entry: