public void Delete_ShouldDeleteConstruction()
        {
            // Arrange
            int id = _rnd.Next(1, _constructions.Count());

            // Act
            _service.Delete(id);

            // Assert
            _repository.Verify(mock => mock.Delete(
                                   It.IsAny <Construction>()), Times.Once);
        }
Exemple #2
0
 public ActionResult Delete(int id)
 {
     try
     {
         _service.Delete(id);
         return(NoContent());
     }
     catch (ArgumentNullException)
     {
         return(NotFound());
     }
 }