public void IsEmpty_Correct() { var p1 = new HumanPlayer("jim"); for (var i = 0; i < 9; i++) { var board = new GameBoard(); Assert.True(board.IsEmpty()); int x, y; board.IndexToCoords(i,out x, out y); board.Occupy(p1,x,y); Assert.False(board.IsEmpty()); } }
public void Occupy_SetsBoardPosition() { var board = new GameBoard(); var p1 = new HumanPlayer("jim"); Assert.False(board.BoardPositions[1][1] != null); board.Occupy(p1, 1, 1); Assert.True(board.BoardPositions[1][1] != null); Assert.AreEqual(p1, board.BoardPositions[1][1]); }
public void Occupy_ThowsIfOccupied() { var board = new GameBoard(); var p1 = new HumanPlayer("jim"); board.Occupy(p1, 1, 1); Assert.Throws<InvalidOperationException>(() => board.Occupy(p1, 1, 1)); }
public void IsPositionOccupied_IsCorrect() { var board = new GameBoard(); var p1 = new HumanPlayer("jim"); Assert.False(board.IsPositionOccupied(1, 1)); board.Occupy(p1, 1, 1); Assert.True(board.IsPositionOccupied(1, 1)); }