Esempio n. 1
0
        public void als_de_eerste_frame_een_spare_dan_is_de_frame_score_10()
        {
            var game = new Game();

            game.Gooi(6);
            game.Gooi(4);

            Assert.AreEqual(10, game.ScoreVoorFrame(1));
        }
Esempio n. 2
0
        private Game GooiPerfectGame()
        {
            var game = new Game();
            for(var i=0; i<12;i++) {
                game.Gooi(10);
            }

            return game;
        }
Esempio n. 3
0
        public void als_de_eerste_3_strikes_dan_is_de_frame_score_van_het_3e_frame_60()
        {
            var game = new Game();

            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);

            Assert.AreEqual(60, game.CurrentScore);
        }
Esempio n. 4
0
        public void als_de_eerste_frame_een_spare_en_de_3e_gooi_5_dan_is_de_frame_score_van_het_1e_frame_15()
        {
            var game = new Game();

            game.Gooi(6);
            game.Gooi(4);

            game.Gooi(5);

            Assert.AreEqual(15, game.ScoreVoorFrame(1));
        }
Esempio n. 5
0
        public void given_i_have_started_a_new_game()
        {
            Game game = null;

            before = () => game = new Game();

            context["And i roll a 5"] = () =>
                    {
                        act = () => game.Roll(5);
                        context["And i roll a 5"] = () =>
                        {
                            act = () => game.Roll(5);
                            context["And i roll a 5"] = () =>
                            {
                                act = () => game.Roll(5);
                                it["My score should now be 20"] = () => game.Score().Should().Be(20);

                            };
                        };
                    };

            context["And i roll a strike"] = () =>
                    {
                        act = () => game.Roll(10);
                        it["My score so far should be 10"] = () => game.Score().Should().Be(10);

                        context["If i then roll two 5"] = () =>
                                                          {
                                                              act = () =>
                                                                    {
                                                                        game.Roll(5);
                                                                        game.Roll(5);
                                                                    };
                                                              it["My score should now be 30"] = () => game.Score().Should().Be(30);
                                                          };
                    };
        }
 protected void SetUp()
 {
     g = new Game();
 }
Esempio n. 7
0
 public void GivenANewBowlingGame()
 {
     Game=new Game();
 }
Esempio n. 8
0
 private void GooiXFrames0(Game game, int x)
 {
     for(var i=0;i<(x*2);i++) {
         game.Gooi(0);
     }
 }
Esempio n. 9
0
 private void Gooi9Frames0(Game game)
 {
     GooiXFrames0(game,9);
 }
Esempio n. 10
0
        public void Throw2PinsShouldSetScore2()
        {
            var game = new Game();

            game.Gooi(2);

            Assert.AreEqual(2, game.CurrentScore);
        }
Esempio n. 11
0
        public void Throw1PinsShouldSetScore1()
        {
            var game = new BowlingGame.Game();

            game.Gooi(1);

            Assert.AreEqual(1, game.CurrentScore);
        }
Esempio n. 12
0
 public void Setup()
 {
     _game = new Game();
     _frames = 10;
 }
Esempio n. 13
0
        public void ThrowTwoConsecutive1PinsGivesScoreForFrame1Is2()
        {
            var game = new Game();

            game.Gooi(1);
            game.Gooi(1);

            Assert.AreEqual(2, game.ScoreVoorFrame(1));
        }
Esempio n. 14
0
        public void ThrowThreeConsecutive1PinsGivesScoreForFrame2Is3()
        {
            var game = new Game();

            game.Gooi(1);
            game.Gooi(1);
            game.Gooi(1);

            Assert.AreEqual(3, game.ScoreVoorFrame(2));
        }
Esempio n. 15
0
        public void ThrowStrikeAnd1And1ShouldSetScoreForFrame1To12()
        {
            var game = new Game();

            game.Gooi(10);
            game.Gooi(1);
            game.Gooi(1);

            Assert.AreEqual(12, game.ScoreVoorFrame(1));
        }
Esempio n. 16
0
        public void ThrowSpareAnd1ShouldSetScoreForFrame1To11()
        {
            var game = new Game();

            game.Gooi(4);
            game.Gooi(6);
            game.Gooi(1);

            Assert.AreEqual(11, game.ScoreVoorFrame(1));
        }
Esempio n. 17
0
        public void ThrowPerfectGameShouldSetScoreTo300()
        {
            var game = new Game();

            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(10);

            //            Assert.AreEqual(300, game.ScoreVoorFrame(10));
            Assert.AreEqual(300, game.CurrentScore);
        }
Esempio n. 18
0
        public void Throw2ConsecutiveRegularScoresShouldSum()
        {
            var game = new Game();

            game.Gooi(1);
            game.Gooi(1);

            Assert.AreEqual(2, game.CurrentScore);
        }
Esempio n. 19
0
        public void ThrowOnlySpareShouldSetScoreTo10()
        {
            var game = new Game();

            game.Gooi(4);
            game.Gooi(6);

            Assert.AreEqual(10, game.ScoreVoorFrame(1));
        }
Esempio n. 20
0
 public GameManager(Game game)
 {
     this.Game = game;
 }
Esempio n. 21
0
 public void Setup()
 {
     game = new BowlingGame.Game();
 }
Esempio n. 22
0
        public void Throw1PinsGivesScoreForFrame1Is1()
        {
            var game = new Game();

            game.Gooi(1);

            Assert.AreEqual(1, game.ScoreVoorFrame(1));
        }
Esempio n. 23
0
 public void TearDown()
 {
     _game = null;
     _frames = 0;
 }
Esempio n. 24
0
        public void NewGameShouldSetCurrentScore0()
        {
            var game = new Game();

            Assert.AreEqual(0, game.CurrentScore);
        }
Esempio n. 25
0
        public void ThrowLessThanZeroShouldGiveException()
        {
            var game = new BowlingGame.Game();

            game.Gooi(-1);
        }
Esempio n. 26
0
        public void Throw2ConsecutiveStrikesAnd1ShouldSetScoreForFrame1To21()
        {
            var game = new Game();

            game.Gooi(10);
            game.Gooi(10);
            game.Gooi(1);

            Assert.AreEqual(21, game.ScoreVoorFrame(1));
        }
Esempio n. 27
0
 public void SetUp()
 {
     game = new Game();
 }
Esempio n. 28
0
 public void SetUp()
 {
     _g = new Game();
 }
Esempio n. 29
0
        private Game GooiVoorbeeldSpel()
        {
            var game = new Game();

            foreach(var score in VoorbeeldSpelScores) {
                game.Gooi(score);
            }

            return game;
        }
Esempio n. 30
0
 public GameTests()
 {
     _game = new Game();
 }