public void RemoveCarFromList()
        {
            Console.Clear();
            Console.WriteLine("Please Enter The Cars VIN That You Would Like To Remove.");
            string input = Console.ReadLine();

            _newCarRepo.RemovCarFromList(input);

            Console.Clear();
            Console.WriteLine("You have successfully removed this car from the list.");
            Console.ReadLine();
        }
Exemple #2
0
        public void Cars_RemoveCarFromList_ShouldRemoveACarFromAList()
        {
            //arrange
            Cars_Repository carRepo  = new Cars_Repository();
            Cars            content  = new Cars(CarType.Electric, 123000, 0, "Tesla", "X", 120, "123ABC");
            Cars            content2 = new Cars(CarType.Gas, 123000, 15.5, "Mazda", "3", 150, "321CBA");

            //act
            carRepo.AddToList(content);
            carRepo.AddToList(content2);
            carRepo.RemovCarFromList("123ABC");
            List <Cars> list     = carRepo.GetList();
            var         actual   = list.Count;
            var         expected = 1;

            //assert
            Assert.AreEqual(actual, expected);
        }