private void Setup() { _shipLength = 1; _ship = LongShip.CreateShip(_shipLength); _defaultStatus = AttackStatus.NotAttacked; _position = new Position("A", 1); _location = BasicLocation.CreateLocation(_position); }
public void OccupyLocationTwice() { Setup(); IShip ship = LongShip.CreateShip(_shipLength); _location.Occupy(ship); TestDelegate test = () => _location.Occupy(_ship); Assert.Throws <LocationOccupiedException>(test); TearDown(); }
void IBoard.PositionBattleship(int battleshipLength, string battleshipRow, int battleshipColumn, Orientation battleshipOrientation) { //this.PositionBattleship(LongShip.CreateShip(battleshipLength), new Position(battleshipRow, battleshipColumn), battleshipOrientation); PositionShipOnArrayBoard.PositionShip(_board, LongShip.CreateShip(battleshipLength), new Position(battleshipRow, battleshipColumn), battleshipOrientation); }
public void CreateShip() { TestDelegate test = () => LongShip.CreateShip(_shipLength); Assert.DoesNotThrow(test); }
public void CreateZeroLengthShip() { TestDelegate test = () => LongShip.CreateShip(0); Assert.Throws <ShipSizeException>(test); }
public void Setup() { _shipLength = 1; _ship = LongShip.CreateShip(_shipLength); }