Example #1
0
        public void CurrentPlayerisOTest()
        {
            tictactoe tictactoe     = new tictactoe();
            string    currentplayer = tictactoe.CurrentPlayer(1);

            Assert.AreEqual("O", currentplayer);
        }
Example #2
0
        public void BoardIsNineField()
        {
            tictactoe tictactoe = new tictactoe();

            tictactoe.CreateBoard();
            Assert.AreEqual(9, tictactoe.TictactoeArray.Length);
        }
Example #3
0
        public void testUnoccupied()
        {
            tictactoe foo = new tictactoe();

            foo.createBoard();
            Assert.AreEqual(foo.board[0, 0], '\0');
        }
Example #4
0
        public void testO()
        {
            tictactoe foo = new tictactoe();

            foo.changePlayer();
            Assert.AreEqual('o', foo.currentPlayer());
        }
Example #5
0
        public void CurrentPlayerPlaceO()
        {
            tictactoe tictactoe = new tictactoe();

            tictactoe.CreateBoard();
            tictactoe.MakeMove(1, "O");
            Assert.AreEqual("O", tictactoe.TictactoeArray[1]);
        }
Example #6
0
        public void CurrentPlayerPlaceX()
        {
            tictactoe tictactoe = new tictactoe();

            tictactoe.CreateBoard();
            tictactoe.MakeMove(2, "X");
            Assert.AreEqual("X", tictactoe.TictactoeArray[2]);
        }
Example #7
0
        public void placementTestX()
        {
            tictactoe foo = new tictactoe();

            foo.createBoard();
            foo.makeMove(0, 0, foo.currentPlayer());
            Assert.AreEqual(foo.board[0, 0], 'x');
        }
Example #8
0
        public void placementIsUsed()
        {
            tictactoe tictactoe = new tictactoe();

            tictactoe.CreateBoard();
            bool inUsed = tictactoe.SpaceinUse(3);

            Assert.AreEqual(false, inUsed);
        }
Example #9
0
        public void nineFieldsTest()
        {
            tictactoe foo   = new tictactoe();
            int       check = 0;

            try
            {
                foo.createBoard();
                for (int i = 0; i < 3; i++)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        Assert.AreEqual(foo.board[i, j], '\0');
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Example #10
0
 private void Awake()
 {
     Script = Camera.GetComponent <tictactoe>();
 }
Example #11
0
        public void testX()
        {
            tictactoe foo = new tictactoe();

            Assert.AreEqual('x', foo.currentPlayer());
        }
Example #12
0
        private void TicTacToe_Click(object sender, EventArgs e)
        {
            tictactoe game = new tictactoe();

            game.checkGameWinner(game.getBoard());
        }