Ejemplo n.º 1
0
 public void Test_DummyThrowNotInsertedAfterStrikeInSecondThrowOfFrame()
 {
     var game = new BowlingGame();
     game.Throw(0);
     game.Throw(10);
     Ashure.That(game.Print().Equals("0 10 | "));
 }
Ejemplo n.º 2
0
 public void Test_DummyThrowInsertedAfterStrikeInFirstThrowOSecondfFrame()
 {
     var game = new BowlingGame();
     // First frame
     game.Throw(1);
     game.Throw(1);
     // Second frame
     game.Throw(10);
     Ashure.That(game.Print().Equals("1 1 | 10 0 | "));
 }
Ejemplo n.º 3
0
 public void Test_GameWith9ThrowsOfOnes_IsInFifthFrame()
 {
     var game = new BowlingGame();
     foreach (var one in Enumerable.Repeat(1, 9))
     {
         game.Throw(one);
     }
     Ashure.That(game.GetCurrentFrame().IsEqualTo(5));
 }
Ejemplo n.º 4
0
 public void Test_GameWith20ThrowsOf1_HasScoreTwenty()
 {
     var game = new BowlingGame();
     foreach (var one in Enumerable.Repeat(1, 20))
     {
         game.Throw(one);
     }
     Ashure.That(game.GetScore().Equals(20));
 }
Ejemplo n.º 5
0
 public void Test_PerfectGame_Scores300()
 {
     var game = new BowlingGame();
     foreach (var ten in Enumerable.Repeat(10, 12))
     {
         game.Throw(ten);
     }
     Ashure.That(game.GetScore().IsEqualTo(300));
 }
Ejemplo n.º 6
0
 public void Test_GameWithSingleThrowOfFive_HasScoreFive()
 {
     var game = new BowlingGame();
     game.Throw(5);
     Ashure.That(game.GetScore().Equals(5));
 }
Ejemplo n.º 7
0
 public void Test_Throwing21Fives_Scores150()
 {
     var game = new BowlingGame();
     foreach (var five in Enumerable.Repeat(5, 21))
     {
         game.Throw(five);
     }
     Ashure.That(game.GetScore().IsEqualTo(150));
 }