public void SetUp()
        {
            TextWriter textWriter = new StringWriter(_output );
            Console.SetOut(textWriter);

            _target = new Game();
        }
        public void ReturnsNumberOfPlayers()
        {
            var game = new Game();

            game.add("Player 1");

            Assert.That(game.howManyPlayers(), Is.EqualTo(1));
        }
        public void GameIsPlayableWith2Players()
        {
            var game = new Game();

            game.add("Player 1");
            game.add("Player 2");

            Assert.That(game.isPlayable(), Is.True);
        }
Beispiel #4
0
        private static void PlayFakeGame()
        {
            var game = new Game();
            game.add("Andreas");
            game.add("Kjersti");
            game.add("Kim");

            bool gameIsrunning = true;

            while (gameIsrunning)
            {
                game.roll(_helper.Throw());

                if (_helper.Answer())
                    gameIsrunning = game.wasCorrectlyAnswered();
                else
                    gameIsrunning = game.wrongAnswer();
            }
            Console.WriteLine("-------------------");
        }
        public void NewGameHasNoPlayers()
        {
            var game = new Game();

            Assert.That(game.howManyPlayers(), Is.EqualTo(0));
        }
        public void GameIsNotPlayableWithNoPlayers()
        {
            var game = new Game();

            Assert.That(game.isPlayable(), Is.False);
        }
 public void GameIsNotPlayableWith1Player()
 {
     var game = new Game();
     game.add("Player 1");
     Assert.That(game.isPlayable(), Is.False);
 }
        public void CanCreateRockQuestion()
        {
            var game = new Game();

            Assert.That(game.createRockQuestion(23), Is.EqualTo("Rock Question 23"));
        }
        public void CanAddPlayer()
        {
            var game = new Game();

            Assert.That(game.add("Player"), Is.True);
        }