public void ElectricCarAdapterBreakTeslaTest() { IElectricCar tesla = null;; // = new Tesla (); ElecticCarAdpater electricCarAdapter = new ElecticCarAdpater(tesla); Assert.IsNotNull(electricCarAdapter); electricCarAdapter.Brake(); }
public void ElectricCarAdapterChangeGearTeslaTest() { IElectricCar tesla = null;; // = new Tesla (); ElecticCarAdpater electricCarAdapter = new ElecticCarAdpater(tesla); Assert.IsNotNull(electricCarAdapter); electricCarAdapter.ChangeGear(); }
private void AddCar() { Console.Clear(); bool continueAsking; do { continueAsking = false; Console.WriteLine("Which type of car do you want to add?\n" + "1. Gas\n" + "2. Hybrid\n" + "3. Electric\n"); string choice = Console.ReadLine(); if (choice == "1") { IGasCar gasCar = GasCarSetup(false); if (_carRepo.CreateCar(gasCar)) { Console.WriteLine("Car was created successfully.\n"); } else { Console.WriteLine("Car was not created successfully. Returning to main menu.\n"); } } else if (choice == "2") { IHybridCar hybridCar = HybridCarSetup(false); if (_carRepo.CreateCar(hybridCar)) { Console.WriteLine("Car was created successfully.\n"); } else { Console.WriteLine("Car was not created successfully. Returning to main menu.\n"); } } else if (choice == "3") { IElectricCar electricCar = ElectricCarSetup(false); if (_carRepo.CreateCar(electricCar)) { Console.WriteLine("Car was created successfully.\n"); } else { Console.WriteLine("Car was not created successfully. Returning to main menu.\n"); } } else { Console.WriteLine("\nPlease enter a valid number.\n"); continueAsking = true; } } while (continueAsking); PressAnyKey(); }
public ElecticCarAdpater(IElectricCar electicCar) { _electricCar = electicCar; }