private void CreateGreenCar()
        {
            Clear();
            GreenCars newGreenCar = new GreenCars();

            WriteLine("\nEnter the Car Type Number:" +
                      "\n1. Gas" +
                      "\n2. Hybrid" +
                      "\n3. Electric");
            int carTypeNum = Int32.Parse(ReadLine());

            newGreenCar.CarType = (CarType)carTypeNum;

            WriteLine("\nEnter the MPG or Miles Per Charge.");
            int mpgInput = Int32.Parse(ReadLine());

            newGreenCar.Mpg = mpgInput;

            WriteLine("\nEnter # of Traffic Tickets.");
            int ticketsInput = Int32.Parse(ReadLine());

            newGreenCar.TrafficTickets = ticketsInput;

            WriteLine("\nEnter # of Miles Driven Per Year.");
            int milesPerYrInput = Int32.Parse(ReadLine());

            newGreenCar.MilesDrivenYr = milesPerYrInput;

            WriteLine("\nEnter Insurance Rate in Dollars Per Year.");
            double insRateInput = Double.Parse(ReadLine());

            newGreenCar.InsuranceRate = insRateInput;

            WriteLine("\nEnter the Car's Primary Use Associated #:" +
                      "\n1. Personal" +
                      "\n2. Work" +
                      "\n3. Pleasure");
            int carUseNum = Int32.Parse(ReadLine());

            newGreenCar.CarUse = (CarUse)carUseNum;

            //Assigned bc num cannot be null in this instance
            newGreenCar.Id = 0;

            _greenCarsRepo.AddGreenCarsToList(newGreenCar);
        }
Exemple #2
0
 private void SetContentTwoGreenCars()
 {
     _testGreenCarsRepo = new GreenCarsRepository();
     _testGreenCarsRepo.AddGreenCarsToList(greenCar1);
     _testGreenCarsRepo.AddGreenCarsToList(greenCar2);
 }