Пример #1
0
        public void GetBoardHorizontalSize_ValidUse_Success()
        {
            // Arrange
            int expectedBoardHorizontalSize = 3;

            // Act
            int actualBoardHorizontalSize = Tictactoe.GetBoardHorizontalSize();

            // Assert
            Assert.AreEqual(expectedBoardHorizontalSize, actualBoardHorizontalSize);
        }
Пример #2
0
        public void ResetBoard_ValidUse_Success()
        {
            // Arrange
            var ticTacToe = new Tictactoe(GetBoardButtons());

            ticTacToe.StartNewGame(true, false, 0);

            // Act
            // ResetBoard method call is in the Tictactoe() ctor

            // Assert
            for (int i = 0; i < Tictactoe.GetBoardHorizontalSize(); i++)
            {
                for (int j = 0; j < Tictactoe.GetBoardVerticalSize(); j++)
                {
                    bool isBoardFieldReset = ticTacToe.IsBoardFieldEmpty(i, j);

                    Assert.AreEqual(true, isBoardFieldReset);
                }
            }
        }