[TestMethod] // 7 public void StrikeFirstFrameGuttersRest() { var game = new Game(); game.Roll(10); SimulateRoll(game, 19, 0); Assert.AreEqual(10, game.Score()); }
private void RollMany(int numberRoll, int pinsKnocked) { for (var i = 0; i < numberRoll; i++) { _game.Roll(pinsKnocked); } }
private void RollMany(int n, int pins) { for (int i = 0; i < n; i++) { game.Roll(pins); } }
public void TestOneSpare() { rollSpare(); g.Roll(3); RollMany(17, 0); Assert.Equal(16, g.TotalScore); }
public static Game RollMany(this Game game, int rolls, ushort pins) { for (var i = 0; i < rolls; i++) { game.Roll(pins); } return(game); }
public void TestOneSpare() { _game.Roll(3); _game.Roll(7); _game.Roll(3); ProcessRolling(17, 0); Assert.AreEqual(16, _game.GetScore()); }
[TestMethod] // 13 public void AllSpares() { var game = new Game(); for (int i = 0; i < 21; i++) { game.Roll(5); } Assert.AreEqual(150, game.Score()); }
[TestMethod] // 9 public void ThreeConsecutiveStrikesPlusTwoBallBonusThenGutters() { var game = new Game(); game.Roll(10); game.Roll(10); game.Roll(10); game.Roll(5); game.Roll(0); game.Roll(5); game.Roll(0); SimulateRoll(game, 10, 0); }
public void RollAndHitInvalidNumberOfPins(int numberOfPinsKnockedDown) { // Given too many pins in a roll _game.Roll(numberOfPinsKnockedDown); // The game ignores the roll and does not give any score Assert.Equal(0, _game.Score()); }
public void Score_UserGetsPinsWithOnlyOnePin_ReturnsTwenty() { Game game = new Game(); for (int i = 1; i <= 20; i++) game.Roll(1); Assert.That(game.Score, Is.EqualTo(20)); }
public void Score_UserGetsNoPoint_ReturnsZero() { Game game = new Game(); for (int i = 1; i <= 20; i++) game.Roll(0); Assert.That(game.Score, Is.EqualTo(0)); }
public void Score_TwoStrikes_AndRestOne() { Game game = new Game(); game.Roll(10); game.Roll(10); for (int i = 1; i <= 16; i++) game.Roll(1); Assert.That(game.Score, Is.EqualTo(49)); }
public void Score_PerfectGame_ResultIs300() { Game game = new Game(); for (int i = 1; i <= 12; i++) game.Roll(10); Assert.That(game.Frames.Count,Is.EqualTo(10)); Assert.That(game.Score, Is.EqualTo(300)); }
public void Score_Game_With_Spares_Only() { Game game = new Game(); for (int i = 1; i <= 21; i++) game.Roll(5); Assert.That(game.Score, Is.EqualTo(150)); }
public void Score_Game_With_Nines_And_Miss_Only() { Game game = new Game(); for (int i = 1; i <= 10; i++) { game.Roll(9); game.Roll(0); } Assert.That(game.Score, Is.EqualTo(90)); }
public static void Main(string[] args) { var game = new Game(); game.Roll(12); }
public static void TakeOneRoll(this Game game, int roll) { game.Roll(roll); }
public static void TakeTwoRolls(this Game game, int firstRoll, int seconeRoll) { game.Roll(firstRoll); game.Roll(seconeRoll); }