public string LoadVehicle(IEnumerable <string> productNames) { foreach (var name in productNames) { var contains = this.productPool.Any(x => x.GetType().Name == name); ExeptionTracker.IsProductInStock(contains, name); } return(StartLoadingCurrentVehicle(productNames)); }
public string SendVehicleTo(string sourceName, int sourceGarageSlot, string destinationName) { var startStore = this.storageRegistry.FirstOrDefault(x => x.Name == sourceName); var targetStore = this.storageRegistry.FirstOrDefault(x => x.Name == destinationName); ExeptionTracker.DoesSourceExists(startStore); ExeptionTracker.DoesDestinationExists(targetStore); var vehicle = startStore.GetVehicle(sourceGarageSlot); var slot = startStore.SendVehicleTo(sourceGarageSlot, targetStore); return($"Sent {vehicle.GetType().Name} to {destinationName} (slot {slot})"); }