Beispiel #1
0
        public void 二回投げて合計値を計算できる()
        {
            var g = new Game();
            g.Roll(3);
            g.Roll(2);

            Assert.That(g.Score(), Is.EqualTo(5));
        }
Beispiel #2
0
        public void 最初でスペアしたときの合計値を計算できる()
        {
            var g = new Game();
            g.Roll(7);
            g.Roll(3);
            g.Roll(5);

            Assert.That(g.Score(), Is.EqualTo(20));
        }
Beispiel #3
0
        public void 最初でストライクしたときの合計値を計算できる()
        {
            var g = new Game();
            g.Roll(10); // 18
            g.Roll(3);  // 8
            g.Roll(5);

            Assert.That(g.Score(), Is.EqualTo(26));
        }
Beispiel #4
0
        public void AllStrike()
        {
            var game = new Game();
            for (int i = 0; i < 12; i++)
            {
                var score = 10;
                game.Roll(score);
                Console.WriteLine("Roll : {0}", score);
            }

            var scores = game.Score();
            Console.WriteLine("Total scores : {0}", scores);

            Assert.That(scores, Is.EqualTo(300));
        }
Beispiel #5
0
 public void Initialize()
 {
     game_ = new Game();
 }
Beispiel #6
0
        public void 最後まで適当に投げる()
        {
            var g = new Game();
            // frame 1
            g.Roll(3);
            g.Roll(5);

            // frame 2
            g.Roll(1);
            g.Roll(1);

            // frame 3
            g.Roll(2);
            g.Roll(3);

            // frame 4 Spear!
            g.Roll(5);
            g.Roll(5);

            // frame 5
            g.Roll(2);
            g.Roll(3);

            // frame 6 Strike!
            g.Roll(10);

            // frame 7
            g.Roll(2);
            g.Roll(3);

            // frame 8
            g.Roll(1);
            g.Roll(1);

            // frame 9
            g.Roll(3);
            g.Roll(0);

            // frame 10
            g.Roll(3);
            g.Roll(3);

            Assert.That(g.Score(), Is.EqualTo(63));
        }
Beispiel #7
0
 public void SetUp()
 {
     g = new Game();
 }
 public void GivenIHaveStartedAGame()
 {
     g = new Game();
 }
Beispiel #9
0
 public GameTests()
 {
     g = new Game();
 }
Beispiel #10
0
 public void TestFixtureTearDown()
 {
     _g = null;
 }
Beispiel #11
0
 public void TestFixtureSetUp()
 {
     _g = new Game();
 }