New ScoreMasterTest Test

Just wanted to put this out there. Whilst trying my many failed attempts to get past this I noticed a missing test. But it was included in the golden copies so it passed Bens code.
[Test]
public void T22GutterBallThenStrike()
{
int[] rolls = { 0, 10, 3 };
int[] totalS = { 13 };
Assert.AreEqual(totalS.ToList(), ScoreMaster.ScoreCumulative(rolls.ToList()));
}

I noticed the exact same thing. This is my test:

[Test]
public void T23StrikeEndOfFrame () {
	int[] rolls = { 1,1, 0,10, 3,4};
	int[] totalS = {  2,   19, 26};
	Assert.AreEqual (totalS.ToList(), ScoreMaster.ScoreCumulative (rolls.ToList()));
}

It is adding only one frame to the bonus, this is treated as a spare (frame total is 10). I’m not sure what the official rules are , but the code needs to account for a strike in the second roll in a frame (easy to implement).

Strikes can only occur in the first Bowl of a frame. If you bowl {0, 10} it is only a spare so will only account for a single bonus.

Your test should therefore account for this:

int[] rolls = { 1,1, 0,10, 3,4};
int[] totalS = { 2, 15, 22};

Makes sense. So it doesn’t matter if it’s 4+6, 8+2, 1+9, or 0+10, it’s
still a spare if it takes the whole frame to knock 'em all down.
I will adjust my test and the code accordingly.

Thanks for this test, James. I had made a note in my code inside an IF statement i made to catch this, saying i should code it later. After running your test, i found the note from my past self and resolved it. By just deleting the if statement. Boom.

RE the comments below… to all those confused by the name of his test, it should really be called:
T22GutterBallThen…SPARE =)

Thanks for sharing! =)