public void GetFrameScoreScenario3Game10IsStrikeAllowstwoMoreBalls() { BowlingKataGame game = new BowlingKataGame(); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); Assert.AreEqual(300, game.GetScores()); Assert.AreEqual(0, game.GetRemainingBonusBalls()); Assert.AreEqual(10, game.GetActiveFrameNumber()); game.RollBall(10);// this ball should be ignored... Assert.AreEqual(300, game.GetScores()); Assert.AreEqual(0, game.GetRemainingBonusBalls()); Assert.AreEqual(10, game.GetActiveFrameNumber()); }
public void StrikeGivesYouTwoBonusBalls() { BowlingKataGame game = new BowlingKataGame(); game.RollBall(10); int actualFrameNumber = game.GetActiveFrameNumber(); int expectedFrameNumber = 2; int actualBonusBalls = game.GetRemainingBonusBalls(); int expectedBonusBalls = 2; Console.WriteLine("Actual Frame" + actualFrameNumber); Console.WriteLine("Actual BonusBalls" + actualBonusBalls); Assert.AreEqual(expectedFrameNumber, actualFrameNumber); Assert.AreEqual(expectedBonusBalls, actualBonusBalls); }
public void GetScorseWhenAStrike() { BowlingKataGame game = new BowlingKataGame(); game.RollBall(10); int actualFrameNumber = game.GetActiveFrameNumber(); int expectedFrameNumber = 2; int actualBonusBalls = game.GetRemainingBonusBalls(); int expectedBonusBalls = 2; Console.WriteLine("Actual Frame" + actualFrameNumber); Console.WriteLine("Actual BonusBalls" + actualBonusBalls); Assert.AreEqual(expectedFrameNumber, actualFrameNumber); Assert.AreEqual(expectedBonusBalls, actualBonusBalls); int actualScore = game.GetScores(); int expectedScore = 10; Assert.AreEqual(expectedScore, actualScore); }
public void GetFrameScoreScenario3Game10IsStrikeAllowsOneMoreBalls() { BowlingKataGame game = new BowlingKataGame(); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(10); game.RollBall(2); //9 game.RollBall(8); //9 game.RollBall(2); game.RollBall(8); game.RollBall(10); game.PrintScores(); // Assert.AreEqual(278, game.GetScores()); Assert.AreEqual(0, game.GetRemainingBonusBalls()); Assert.AreEqual(10, game.GetActiveFrameNumber()); }