Esempio n. 1
0
        public void TestMethod1()
        {
            GameBoardPage boardPage = new GameBoardPage();
            boardPage.Show();


        }
Esempio n. 2
0
        public void Set()
        {
            var gameBoardPage = new GameBoardPage();
            gameBoardPage.Show();

            gameBoardPage.Set(this);
            if (CrossesMovesFirst)
            {
                gameBoardPage.radioCrossMoveFirst.Checked = true;
            }
        }
Esempio n. 3
0
        public void Set()
        {
            var gameBoardPage = new GameBoardPage();

            gameBoardPage.Show();

            gameBoardPage.Set(this);
            if (CrossesMovesFirst)
            {
                gameBoardPage.radioCrossMoveFirst.Checked = true;
            }
        }
Esempio n. 4
0
        public void UpdateFromCurrentStatus()
        {
            var gameBoardPage = new GameBoardPage();

            var actual = gameBoardPage.GetStatus();

            this.CrossesMovesFirst = actual.CrossesMovesFirst;
            this.CrossesPlayerType = actual.CrossesPlayerType;
            this.CrossesWinsCount = actual.CrossesWinsCount;
            this.CrossesWinsPercent = actual.CrossesWinsPercent;
            this.DrawsCount = actual.DrawsCount;
            this.DrawsPercent = actual.DrawsPercent;
            this.NoughtsPlayerType = actual.NoughtsPlayerType;
            this.NoughtsWinsCount = actual.NoughtsWinsCount;
            this.NoughtsWinsPercent = actual.NoughtsWinsPercent;
        }
Esempio n. 5
0
        public void UpdateFromCurrentStatus()
        {
            var gameBoardPage = new GameBoardPage();

            var actual = gameBoardPage.GetStatus();

            this.CrossesMovesFirst  = actual.CrossesMovesFirst;
            this.CrossesPlayerType  = actual.CrossesPlayerType;
            this.CrossesWinsCount   = actual.CrossesWinsCount;
            this.CrossesWinsPercent = actual.CrossesWinsPercent;
            this.DrawsCount         = actual.DrawsCount;
            this.DrawsPercent       = actual.DrawsPercent;
            this.NoughtsPlayerType  = actual.NoughtsPlayerType;
            this.NoughtsWinsCount   = actual.NoughtsWinsCount;
            this.NoughtsWinsPercent = actual.NoughtsWinsPercent;
        }
Esempio n. 6
0
        public void Set()
        {
            var boradPage = new GameBoardPage();
            var gameBoard = this.ToArray();

            boradPage.Show();


            GameConfiguration configuration = new GameConfiguration();

            configuration.UpdateFromCurrentStatus();

            bool isCrossMove = configuration.CrossesMovesFirst;

            for (int n = 0; n < gameboardWidth * gameboardHeight; n++)
            {
                for (int x = 0; x < gameboardWidth; x++)
                {
                    for (int y = 0; y < gameboardHeight; y++)
                    {
                        int cellIndex = (y * gameboardHeight) + x;

                        bool isValidCrossMove   = String.Compare(X, gameBoard[cellIndex], true) == 0 && isCrossMove;
                        bool isValidNoughtsMove = String.Compare(O, gameBoard[cellIndex], true) == 0 &&
                                                  isCrossMove == false;

                        bool isValidMove = isValidCrossMove || isValidNoughtsMove;

                        if (isValidMove)
                        {
                            boradPage.Move(cellIndex);
                            gameBoard[cellIndex] = Empty;
                            isCrossMove          = !isCrossMove;
                            System.Threading.Thread.Sleep(50);
                        }
                    }
                }
            }
        }
 public void WhenCrossesMakeAMoveToCellC1(string cell)
 {
     var boardPage = new GameBoardPage();
     boardPage.Move(cell);
 }
 public void GivenCrossesMovesFirst()
 {
     var boardPage = new GameBoardPage();
     boardPage.CorssesMoveFirst();
 }
 public void GivenTheGameStatisticsIsCleared()
 {
     var boardPage = new GameBoardPage();
     boardPage.ClearStats();
 }
Esempio n. 10
0
        public void TestMethod2()
        {

            GameBoardPage boardPage = new GameBoardPage();
            boardPage.Show();

            GameBoard board = new GameBoard();
            board.AddRange(new string[] 
            { "x", "o", "x", 
              "", "x", "" ,
              "o", "", "" });
            board.Set();
        }