Another falling test (with solution)

Hi everyone,

I got another failing test:

    [Test]
public void T18LastFrame3_7_3()
{
    int[] rolls = { 10, 10, 10, 10, 10, 10, 10, 10, 10, 3,7,3 };
    string rollsString = "X X X X X X X X X 3/3";
    Assert.AreEqual(rollsString, ScoreDisplay.FormatRolls(rolls.ToList()));
}

With the ScoreDisplay.cs of the course we will get:
Expected: "X X X X X X X X X 3/3"
But was: “X X X X X X X X X 3//”

My solution to this was change the SPARE check by the following:

else if ((box%2 == 0 || box == 21) && rolls[i]+rolls[i-1] == 10 && output[output.Length-1].ToString() != "/")
        {
            output += "/";
        }
2 Likes

Thanks for this! I noticed it, and knew I could fix it, but didn’t want to overcome another bug considering the course is done.

Onwards and upwards!

Cheers!

1 Like