private void ShowACar() { Console.WriteLine("What is the car ID you want to see?"); int carID = int.Parse(Console.ReadLine()); GreenPlan crud = _carRepo.GetCarInfo(carID); Console.WriteLine($"{crud.CarID} {crud.YearOfCar} {crud.MakeOfCar} {crud.ModelOfCar} {crud.GasMileage} {crud.CarType} "); Console.ReadLine(); }
public void AddAndGetInfoForOneCar() { GreenRepository repoInfo = new GreenRepository(); GreenPlan customerInfo = new GreenPlan(1, 2015, "Honda", "Sonata", 32d, CarType.Hybrid); GreenPlan customerInfo2 = new GreenPlan(2, 2010, "Honda", "Sonata", 32d, CarType.Hybrid); repoInfo.AddCarToList(customerInfo); repoInfo.AddCarToList(customerInfo2); var expected = customerInfo2; var actual = repoInfo.GetCarInfo(2); Assert.AreEqual(expected, actual); }