public void SquareUI_WithPositiveBoardSize_HasRightSize(int row, int column, int boardUISize, int expectedWidth, int expectedHeight) { SquareUI squareUI = new SquareUI(row, column, boardUISize); Size expectedSize = new Size(expectedWidth, expectedHeight); Size actualSize = squareUI.Size; Assert.AreEqual(expectedSize, actualSize); }
public void SquareUI_WithPositiveBoardIndexesAndBoardUISize_HasRightLocation(int row, int column, int boardUISize, int expectedY, int expectedX) { SquareUI squareUI = new SquareUI(row, column, boardUISize); Point expectedPosition = new Point(expectedX, expectedY); Point actualPosition = squareUI.Location; Assert.AreEqual(expectedPosition, actualPosition); }
public void SquareUI_WithPositiveIndexes_HasRightBackgroundColor(int row, int column, int colorIndex) { Color[] squareColors = new Color[] { Color.White, Color.DimGray }; SquareUI squareUI = new SquareUI(row, column, 0); Color expectedColor = squareColors[colorIndex]; Color actualColor = squareUI.BackColor; Assert.AreEqual(expectedColor, actualColor); }
public void BoardUI_WithSizeParameter_CreatesRowsWithAlternatingColors() { BoardUI boardUI = new BoardUI(0, new Board()); for (int column = 0; column < 10; column++) { for (int row = 0; row < 9; row++) { SquareUI currentSquare = boardUI.Squares[row, column]; SquareUI nextSquare = boardUI.Squares[row + 1, column]; if (currentSquare.BackColor == nextSquare.BackColor) { Assert.Fail(); } } } }
void Awake() { _instance = this; }
public void SquareUI_WithIndexesLargerThanMaximumLimit_ThrowsIndexOutOfRangeException(int row, int column) { SquareUI squareUI = new SquareUI(row, column, 0); }
public void SquareUI_WithNegativeIndexes_ThrowsIndexOutOfRangeException(int row, int column) { SquareUI squareUI = new SquareUI(row, column, 0); }