public void TestAddSpaceShipToArray() { SpaceShip[] spaceShips = CreateSpaceShips(5); spaceShips = ArrayUtils.AddToArray(spaceShips, CreateSpaceShip("NewSpaceShip")); Assert.That(spaceShips.Length, Is.EqualTo(6)); Assert.That(spaceShips[5].ShipClassName, Is.EqualTo("NewSpaceShip")); }
private void RemoveDestroyedShipFromService(SpaceShip destroyedSpaceShip, int spaceShipIndex) { DestroyedSpaceShips = ArrayUtils.AddToArray(DestroyedSpaceShips, destroyedSpaceShip); SpaceShipsInService = ArrayUtils.RemoveFromArray(SpaceShipsInService, spaceShipIndex); }