Ejemplo n.º 1
0
        private void validationOfWheels(Dictionary <string, string> i_VehicleInfo)
        {
            float maximalAirPressure = PropertiesValidation.PositiveFloatValidation(i_VehicleInfo["Wheel maximal air pressure:"]);

            try
            {
                float currentAirPressure = PropertiesValidation.PositiveFloatValidation(i_VehicleInfo["Wheel current air pressure:"]);
                PropertiesValidation.ValidateCurrentAmount(currentAirPressure, maximalAirPressure);
            }
            catch (Exception ecxeption)
            {
                throw new ArgumentException("impossible wheel current air pressure. " + ecxeption.Message);
            }
        }
Ejemplo n.º 2
0
        private static void validationOfEngine(string i_CurrentEnergyAmount, string i_MaxEnergyAmount)
        {
            float MaxEnergyAmount = PropertiesValidation.PositiveFloatValidation(i_MaxEnergyAmount);

            try
            {
                float CurrentEnergyAmount = PropertiesValidation.PositiveFloatValidation(i_CurrentEnergyAmount);
                PropertiesValidation.ValidateCurrentAmount(CurrentEnergyAmount, MaxEnergyAmount);
            }
            catch (Exception ecxeption)
            {
                throw new ArgumentException("impossible current energy amount. " + ecxeption.Message);
            }
        }