public void Shoud_Return_Same_Number_Of_Car_After_Add() { var car1 = AddCar(998); var car2 = AddCar(997); List <Car> carList = new List <Car> { car1, car2 }; CarRepository.Setup(a => a.GetCars()) .Returns(carList); var result = CarService.GetCars(); Assert.AreEqual(result.Count(), 2); }
public ActionResult <IList <Car> > GetAllCars() { var cars = _carService.GetCars(); return(Ok(cars)); }