public void SeeAllCarsOnList()
        {
            Console.Clear();
            List <Car> list = _greenRepo.SeeAllCarsOnList();

            foreach (Car item in list)
            {
                Console.WriteLine($"{item.CarType} {item.Make} {item.Model} {item.YearofCar} {item.NumberofDoors} {item.CarID} ");
            }

            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
        }
Esempio n. 2
0
        public void RemoveCarFromList()
        {
            GreenRepository _greenRepo = new GreenRepository();
            Car             car        = new Car(CarType.Gas, "Honda", "Accord", 2009, 4, 256);

            Car carTwo = new Car();

            _greenRepo.AddCarToList(car);
            _greenRepo.AddCarToList(carTwo);

            _greenRepo.RemoveCarFromList(256);

            int actual   = _greenRepo.SeeAllCarsOnList().Count;
            int expected = 1;

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void AddCarToListTest()

        {
            GreenRepository _greenRepo = new GreenRepository();
            Car             car        = new Car(CarType.Gas, "Honda", "Accord", 2009, 4, 256);


            _greenRepo.AddCarToList(car);

            List <Car> list = _greenRepo.SeeAllCarsOnList();

            int actual   = list.Count;
            int expected = 1;

            Assert.AreEqual(expected, actual);
            Assert.IsTrue(list.Contains(car));
        }