Beispiel #1
0
        public void TTT_matrixSameCell_Exception()
        {
            TicTacTeo ttt = new TicTacTeo();

            ttt.Play(1, 1);
            Assert.Throws <InvalidOperationException>(() => ttt.Play(1, 1));
        }
Beispiel #2
0
        public void TTT_XisWinnerHorizontal_succes()
        {
            TicTacTeo ttt = new TicTacTeo();

            ttt.Play(1, 1); // x
            ttt.Play(2, 2); //O
            ttt.Play(1, 2); //x
            ttt.Play(3, 3); //o
            Assert.Equal("X is Winner", ttt.Play(1, 3));
        }
Beispiel #3
0
        public void TTT_XisWinnerVertically_succes()
        {
            TicTacTeo ttt = new TicTacTeo();

            ttt.Play(1, 1); // x
            ttt.Play(2, 2); //O
            ttt.Play(2, 1); //x
            ttt.Play(3, 3); //o
            Assert.Equal("X is Winner", ttt.Play(3, 1));
        }
Beispiel #4
0
        public void TTT_OisWinnerDraw_succes()
        {
            TicTacTeo ttt = new TicTacTeo();

            ttt.Play(1, 1);                             // x
            ttt.Play(2, 2);                             //O
            ttt.Play(3, 3);                             //x
            ttt.Play(3, 1);                             //x
            ttt.Play(3, 2);                             //o
            ttt.Play(1, 3);                             //o

            ttt.Play(1, 2);                             //x

            ttt.Play(2, 3);                             //x

            Assert.Equal("Its a Draw", ttt.Play(2, 1)); //Object is winner
        }
Beispiel #5
0
        public void TTT_OisWinnerHorizantal_succes()
        {
            TicTacTeo ttt = new TicTacTeo();

            ttt.Play(2, 2);                              // x
            ttt.Play(1, 1);                              //O
            ttt.Play(2, 3);                              //x
            ttt.Play(1, 2);                              //o
            ttt.Play(3, 1);                              //x
            Assert.Equal("O is Winner", ttt.Play(1, 3)); //Object is winner
        }
Beispiel #6
0
        public void TTT_matrixValueGreater_OutOfRange()
        {
            TicTacTeo ttt = new TicTacTeo();

            Assert.Throws <InvalidOperationException>(() => ttt.Play(5, 5));
        }