Ejemplo n.º 1
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);
        }