Exemplo n.º 1
0
        public void PlayerWins(char[] cells)
        {
            // arrange
            var players = new[]
            {
                new Player("Player 1", s_X),
                new Player("Player 2", s_O)
            };

            var ttt = new TicTacToeGame(new MockConsole(), cells, players);

            // act
            bool result = ttt.PlayerWins(s_X);

            // assert
            Assert.True(result);
        }
Exemplo n.º 2
0
        public void IsDraw()
        {
            // arrange
            var players = new[]
            {
                new Player("Player 1", s_X),
                new Player("Player 2", s_O)
            };

            var cells = new[] { s_X, s_X, s_X, s_O, s_O, s_O, s_X, s_X, s_X };

            var ttt = new TicTacToeGame(new MockConsole(), cells, players);

            // act
            bool result = ttt.IsDraw();

            // assert
            Assert.True(result);
        }