public void Should_Return_Same_Car_Id_In_FindCarById()
        {
            var car = AddCar(996);

            CarRepository.Setup(a => a.FindCarById(996))
            .Returns(car);

            //validate
            var output = CarService.FindCarById(996);

            Assert.AreEqual(output.Id, 996);
        }
Ejemplo n.º 2
0
        public ActionResult <Car> FindCarById(int id)
        {
            var car = _carService.FindCarById(id);

            if (car != null)
            {
                return(Ok(car));
            }
            return(NotFound());
        }