public void CheckIfVehicleTypeExist(Vehicle vehicle)
 {
     if (!_basePremiums.Keys.Contains(vehicle.GetType()))
         throw new VehicleTypeNotExistException();
 }
        public double GetBasePremiumFor(Vehicle vehicle)
        {
            CheckIfVehicleTypeExist(vehicle);

            return _basePremiums[vehicle.GetType()];
        }
 public void Validate(Vehicle vehicle)
 {
     _basePremiumStore.CheckIfVehicleTypeExist(vehicle);
 }
 public double GetFactorFor(Vehicle vehicle)
 {
     CheckIfManufacturerExist(vehicle);
     return _factors[vehicle.Manufacturer.GetType()];
 }
 public void CheckIfManufacturerExist(Vehicle vehicle)
 {
     if (!_factors.Keys.Contains(vehicle.Manufacturer.GetType()))
         throw new ManufacturerNotFoundException();
 }
Пример #6
0
 protected bool Equals(Vehicle other)
 {
     return Equals(Manufacturer, other.Manufacturer);
 }
 public void Validate(Vehicle vehicle)
 {
     _manufacturerStore.CheckIfManufacturerExist(vehicle);
 }