Exemplo n.º 1
0
  @Test
  public void testPlaceShip() throws ShipTooCloseException {
    Coordinate[] shipCoordinates = new Coordinate[] {new Coordinate(1, 1)};
    battlefield.placeShip(shipCoordinates);

    assertArrayEquals(new Boolean[] {true}, battlefield.getShipsByCoordinates(shipCoordinates));
  }
Exemplo n.º 2
0
 @Test
 public void testInitiallyNoShips() {
   assertArrayEquals(
       new Boolean[] {false, false, false, false}, battlefield.getShipsByCoordinates(coordinates));
 }