Exemplo n.º 1
0
        public virtual long GetPriceForVehicle(Vehicle vehicle)
        {
            var vehicleSize = vehicle.Model.Size;
            var servicePrice = _servicePrices.FirstOrDefault(sp => sp.VehicleSize == vehicleSize);

            if (servicePrice == null)
            {
                throw new ApplicationException(string.Format(@"No price found in service '{0}' for vehicle size '{1}'", Name, vehicleSize));
            }

            return servicePrice.Price;
        }
 public VehicleRegistration(Customer customer, Vehicle vehicle, DateTime expiryDate)
 {
     _registeredTo = customer;
     _registeredVehicle = vehicle;
     _expiryDate = expiryDate;
 }
 public VehicleAlreadyRegisteredException(Customer customer, Vehicle vehicle)
 {
     _customer = customer;
     _vehicle = vehicle;
 }
 public VehicleRegistration(Customer customer, Vehicle vehicle)
 {
     _registeredTo = customer;
     _registeredVehicle = vehicle;
 }