public void For_An_Open_Frame_The_Score_Is_The_Total_Number_Of_Pins_Knocked_Down() { Game game = new Game(); game.Roll(1); game.Roll(2); var score = game.Score; Assert.AreEqual(3, score); }
public void When_Roll_Through_the_Game_Last_Frame_That_Is_Not_Done_Will_Be_Added_Pins() { Game g = new Game(); g.Roll(10);//Frame 1 g.Roll(2);//Frame 2 g.Roll(2);//Frame 2 g.Roll(5);//Frame 3 var firstFrame = g.Frames[0]; Assert.IsTrue(firstFrame.IsDone); Assert.AreEqual(Mark.Strike, firstFrame.Mark); var secondFrame = g.Frames[1]; Assert.IsTrue(secondFrame.IsDone); Assert.AreEqual(Mark.Open, secondFrame.Mark); var thirdFrame = g.Frames[2]; Assert.IsFalse(thirdFrame.IsDone); Assert.AreEqual(Mark.Open, secondFrame.Mark); }
public void A_Game_Consists_Of_Ten_Frames() { Game g = new Game(); Assert.AreEqual(10, g.Frames.Count); }
public JsonResult Frames(List<FrameViewModel> frames) { var game = new Game(); game.Rolls(frames); return Json(new {score= game.Score}); }
public static int Calculate(Action<Game> action)// this method should be used as API because it calls SCORE. { var game = new Game(); action(game); return game.Score; }