Exemple #1
0
        public IActionResult Delete(int id)
        {
            try
            {
                repo.DeleteCar(id);
                return(Ok());
            }

            catch (Exception e)
            { return(StatusCode(500, e)); }
        }
Exemple #2
0
        public void DeleteCar_Test()
        {
            //Arrange
            CarsRepository repo = new CarsRepository();
            Car            car  = new Car {
                Id = 2, Make = "Murano", Model = "SL", Year = 2014, Manufacturer = "Nissan"
            };

            //Act
            var deleted = repo.DeleteCar(car.Id);

            //Assert
            Assert.IsTrue(deleted);
        }
Exemple #3
0
 private void DeleteCar(CarsRepository repository, long carId)
 {
     repository.DeleteCar(carId);
 }