public void ScoreboardCalculatesFrame10ScoresCorrectly(int roll1, int roll2, int roll3, int expected) { int[][] frames = new[] { new[] { 0, 0 }, new[] { 0, 0 }, new[] { 0, 0 }, new[] { 0, 0 }, new[] { 0, 0 }, new[] { 0, 0 }, new[] { 0, 0 }, new[] { 0, 0 }, new[] { 0, 0 }, new[] { roll1, roll2, roll3 }, }; var sut = new Scoreboard(frames); var result = sut.CalculateFinalScore(); result.Should().Be(expected); }
static void Main() { int[][] frames = new[] { new[] { 4, 3 }, new[] { 7, 3 }, new[] { 5, 2 }, new[] { 8, 1 }, new[] { 4, 6 }, new[] { 2, 4 }, new[] { 8, 0 }, new[] { 8, 0 }, new[] { 8, 2 }, new[] { 10, 1, 7 }, }; Scoreboard scoreboard = new Scoreboard(frames); var score = scoreboard.CalculateFinalScore(); Console.WriteLine($"Your final score is: {score}"); }
public void ScoreboardCalculatesScoreCorrectly() { int[][] frames = new[] { new[] { 4, 3 }, new[] { 7, 3 }, new[] { 5, 2 }, new[] { 8, 1 }, new[] { 4, 6 }, new[] { 2, 4 }, new[] { 8, 0 }, new[] { 8, 0 }, new[] { 8, 2 }, new[] { 10, 1, 7 }, }; var sut = new Scoreboard(frames); var result = sut.CalculateFinalScore(); result.Should().Be(110); }