public void HaveNotZeroScore_AfterSuccessRoll() { var game = new Game(); game.Roll(7); game.GetScore().Should().Be(7); }
private void RollMany(int n, int pins) { for (int i = 0; i < n; i++) { g.Roll(pins); } }
public void GameEnd_AndTryRollOneMoreTime_IndexOutOfRangeException() { Game game = new Game(); SetCurrentRound(game, 10); Action act = () => game.Roll(1); act.ShouldThrow <IndexOutOfRangeException>(); }
public void CalcSpare() { game.Roll(3); game.Roll(7); game.Roll(4); game.Roll(2); RollMany(16, 0); Assert.AreEqual(20, game.Score()); }
public void WorstBowlingPlayerOfTheWorld() { for (int roll = 0; roll < 20; roll++) { game.Roll(0); } Assert.That(game.GetScore(), Is.EqualTo(0)); }
public void TestOneSpare() { Setup(); RollSpare(); game.Roll(3); RollMany(17, 0); Assert.AreEqual(16, game.Score()); }
public int GetScore_After(int[] throws) { var game = new Game(); foreach (var pins in throws) { game.Roll(pins); } return(game.GetScore()); }
public void GameWithAllStrikes_ScoreIs300() { Game game = new Game(); for (Int32 i = 0; i < 12; i++) { game.Roll(10); } game.GetScore().Should().Be(300); }
public void RollAllPinsInOneRoll_GameRoundIsStrike() { Game game = new Game(); game.Roll(10); GetRound(game, 0) .IsStrike .Should() .Be(true); }
public void HaveRollsSum_AfterSomeRolls(IEnumerable <int> rolls, int result) { var game = new Game(); foreach (var roll in rolls) { game.Roll(roll); } game.GetScore() .Should().Be(result); }
public int GetScoreTest(params int[] rolls) { foreach (var pins in rolls) { game.Roll(pins); } var t = game.GetScore(); return(t); }
static void Main(string[] args) { game = new Game(); for (int i = 1; i < 10; i++) { var pinsKnocked = int.Parse(Write("Enter number of pins knocked: ")); game.Roll(pinsKnocked); Console.Clear(); Display(); } }
public void ShouldNotThrowInvalidOperationException_AfterMultipleBitInLastFrame(IEnumerable <int> rolls) { var game = new Game(); Action beats = () => { foreach (var roll in rolls) { game.Roll(roll); } }; beats.ShouldNotThrow <InvalidOperationException>(); }
public void ThrowArgumentException(IEnumerable <int> rolls) { var game = new Game(); Action beats = () => { foreach (var roll in rolls) { game.Roll(roll); } }; beats.ShouldThrow <ArgumentException>(); }
public void ThrowInvalidOperationException_AfterNumberOfFramesMoreThen10() { var rolls = new[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 5, 10 }; var game = new Game(); Action beats = () => { foreach (var roll in rolls) { game.Roll(roll); } }; beats.ShouldThrow <InvalidOperationException>(); }
static void Main() { int[] rolls = new int[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }; var g = new Game(); foreach (int pins in rolls) { g.Roll(pins); } g.Score(); Console.WriteLine($"Final Score: {g.GameScore}"); Console.ReadLine(); }
public void DobleRollTest() { game.Roll(4); game.Roll(4); game.GetScore().Should().Be(8); }
public void FirstFrameScoreShouldBeGreaterThan10_WhenStrike() { game.Roll(10); game.Roll(5); game.Roll(5); game.Frames[0].Score.Should().Be(20); }
public void ScoreOfOneRoll() { game.Roll(2); game.GetScore().Should().Be(2); }
public void HaveScoreEqualToRollPins_AfterOneRoll() { game.Roll(7); game .GetScore() .Should().Be(7); }
public void HaveCorrectScore_AfterAnyRoll() { game.Roll(4); game.GetScore().Should().Be(4); }
public void HaveRightScore_AfterOneRoll() { game.Roll(5); game.GetScore().Should().Be(5); }
private void Strike() { game.Roll(game.FramePinsAmount); }
public void TestGame_ScoreIs133() { Game game = new Game(); game.Roll(1); game.Roll(4); game.Roll(4); game.Roll(5); game.Roll(6); game.Roll(4); game.Roll(5); game.Roll(5); game.Roll(10); game.Roll(0); game.Roll(1); game.Roll(7); game.Roll(3); game.Roll(6); game.Roll(4); game.Roll(10); game.Roll(2); game.Roll(8); game.Roll(6); game.GetScore().Should().Be(133); }
public void ScoreAdd_AfterRoll_EqualsKeglCount() { game.Roll(4); game.GetScore().Should().Be(4); }