Exemplo n.º 1
0
        public void FillFuelVehicle()
        {
            float  amountOfFuel;
            int    typeOfFuel;
            string licenseNumber = GetLicenseNumber();
            bool   vehicleExist  = m_Garage.VehicleExistInGarage(licenseNumber);

            if (vehicleExist)
            {
                amountOfFuel = m_UI.GetFloatInput();
                m_UI.PrintMessage(Messages.AskingTypeOfFuel);
                typeOfFuel = m_UI.GetIntInRange(1, 4);
                m_Garage.FillFuel(licenseNumber, amountOfFuel, (eFuelType)typeOfFuel);
            }
            else
            {
                string errMsg = string.Format("Vehicle {0} is not existing in the garage", licenseNumber);
                throw new ArgumentException(errMsg);
            }
        }