public void ReadOnlyList() { var board = new BattleshipBoard(); board.PlaceShip(new BoardIndex(0, 0), 1, Direction.Horizontal); Assert.Equal(SquareContent.Ship, board[0]); Assert.Equal(SquareContent.Water, board[99]); }
public void PlaceShip_Horizontal() { var board = new BattleshipBoard(); board.PlaceShip(new BoardIndex(0, 0), 2, Direction.Horizontal); Assert.Equal(SquareContent.Ship, board[new BoardIndex(0, 0)]); Assert.Equal(SquareContent.Ship, board[new BoardIndex(1, 0)]); Assert.Equal(2, board.Count(s => s == SquareContent.Ship)); }