public void SetFramesCanBeUsedToAddDataToFrames() { Game g = new Game(); g.SetFrames("-123-"); Assert.AreEqual(1, g.GetFrameScore(0)); Assert.AreEqual(5, g.GetFrameScore(1)); }
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); }
protected void SetUp() { game = new BowlingKata.Game(); }
public void ConstructorCreatesEmptyGame() { Game g = new Game(string.Empty); Assert.AreEqual(10, g.FrameCount); }
static void Main(string[] args) { Game myGame = new Game(); // Frame 1 myGame.roll(6); myGame.roll(1); // Frame 2 myGame.roll(9); myGame.roll(0); // Frame 3 myGame.roll(8); myGame.roll(2); // Frame 4 myGame.roll(5); myGame.roll(5); // Frame 5 myGame.roll(8); myGame.roll(0); // Frame 6 myGame.roll(6); myGame.roll(2); // Frame 7 myGame.roll(9); myGame.roll(1); // Frame 8 myGame.roll(7); myGame.roll(2); // Frame 9 myGame.roll(8); myGame.roll(2); // Frame 10 myGame.roll(9); myGame.roll(1); myGame.roll(7); if (myGame.score() == 127) Console.WriteLine("Winnrar"); else Console.WriteLine("Loser."); }
public void GetScoreSubtractsFirstRollInCaseOfSpare() { Game g = new Game("5/5/5/5/5/5/5/5/5/5/5"); Assert.AreEqual(150, g.GetScore()); }
public void GetScoreDoesLookAheadToLastFrame() { Game g = new Game("XXXXXXXXXXXX"); Assert.AreEqual(300, g.GetScore()); }
public void GetFrameScoreReturnsCorrectScores(string game, int expectedScore) { Game g = new Game(game); Assert.AreEqual(expectedScore, g.GetFrameScore(0)); }
public void ConstructorCreatesNonEmptyGame() { Game g = new Game("-1-2"); Assert.AreEqual(10, g.FrameCount); Assert.AreEqual(1, g.GetFrameScore(0)); }
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 DescribeBowlingGame() { game = new Game(); }
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 SetUp() { _game = new Game(); }