Esempio n. 1
0
        public void GameFieldCount()
        {
            Spielfeld s = new Spielfeld();

            s.GetBoard();
            Assert.IsTrue(s.GetBoard().Length == 9);
        }
Esempio n. 2
0
        public void TurnInvalid()
        {
            Spielfeld s = new Spielfeld();

            s.GetBoard();
            s.Turn(new Point(0, 0));
            Assert.IsTrue(s.Turn(new Point(0, 0)) == TurnResult.Invalid);
        }
Esempio n. 3
0
        public void TurnToWinHorizontalRow2()
        {
            Spielfeld s = new Spielfeld();

            s.GetBoard();
            s.Turn(new Point(2, 0));
            s.Turn(new Point(0, 0));
            s.Turn(new Point(2, 1));

            s.Turn(new Point(0, 1));
            Assert.IsTrue(s.Turn(new Point(2, 2)) == TurnResult.Win);
        }
Esempio n. 4
0
        public void TurnToWinDiagonal1()
        {
            Spielfeld s = new Spielfeld();

            s.GetBoard();
            s.Turn(new Point(0, 2));
            s.Turn(new Point(0, 1));
            s.Turn(new Point(1, 1));

            s.Turn(new Point(2, 1));
            Assert.IsTrue(s.Turn(new Point(2, 0)) == TurnResult.Win);
        }
Esempio n. 5
0
        public void TurnToWinVerticalCol2()
        {
            Spielfeld s = new Spielfeld();

            s.GetBoard();
            s.Turn(new Point(0, 2));
            s.Turn(new Point(0, 1));
            s.Turn(new Point(1, 2));

            s.Turn(new Point(1, 1));
            Assert.IsTrue(s.Turn(new Point(2, 2)) == TurnResult.Win);
        }
Esempio n. 6
0
        public void TurnTie()
        {
            Spielfeld s = new Spielfeld();

            s.GetBoard();
            s.Turn(new Point(0, 0));
            s.Turn(new Point(1, 0));
            s.Turn(new Point(2, 0));

            s.Turn(new Point(1, 1));
            s.Turn(new Point(0, 1));
            s.Turn(new Point(0, 2));

            s.Turn(new Point(2, 1));
            s.Turn(new Point(2, 2));
            Assert.IsTrue(s.Turn(new Point(1, 2)) == TurnResult.Tie);
        }