コード例 #1
0
        public void CanNotMoveOpponent()
        {
            TicTacToeVariant ticTacToe = new TicTacToeVariant();

            ticTacToe.Place(1, 1);
            ticTacToe.Move(1, 1, 2, 2);
            char[,] reference =
            {
                { ' ', ' ', ' ' },
                { ' ', 'X', ' ' },
                { ' ', ' ', ' ' },
            };
            CollectionAssert.AreEqual(reference, ticTacToe.GameBoard);
        }
コード例 #2
0
        public void CanMove()
        {
            TicTacToeVariant ticTacToe = new TicTacToeVariant();

            char[,] check =
            {
                { 'X', ' ', ' ' },
                { ' ', ' ', 'X' },
                { 'X', ' ', ' ' },
            };
            char[,] reference =
            {
                { ' ', ' ', ' ' },
                { ' ', 'X', 'X' },
                { 'X', ' ', ' ' },
            };
            ticTacToe.GameBoard = check;
            ticTacToe.Move(0, 0, 1, 1);
            CollectionAssert.AreEqual(reference, ticTacToe.GameBoard);
        }
コード例 #3
0
        public void TicTacToeNoMoreThan3()
        {
            TicTacToeVariant ticTacToe = new TicTacToeVariant();

            char[,] check =
            {
                { 'X', ' ', ' ' },
                { ' ', ' ', 'X' },
                { 'X', ' ', ' ' },
            };
            char[,] reference =
            {
                { 'X', ' ', ' ' },
                { ' ', ' ', 'X' },
                { 'X', ' ', ' ' },
            };
            ticTacToe.GameBoard = check;
            ticTacToe.Place(1, 1);
            CollectionAssert.AreEqual(reference, ticTacToe.GameBoard);
        }