Exemplo n.º 1
0
        public void Delete_ShouldDeleteDoc()
        {
            // Arrange
            int id = _rnd.Next(1, _docs.Count());

            // Act
            _service.Delete(id);

            // Assert
            _repository.Verify(mock => mock.Delete(It.IsAny <Doc>()), Times.Once);
        }
Exemplo n.º 2
0
 public ActionResult Delete(int id)
 {
     try
     {
         _service.Delete(id);
         return(NoContent());
     }
     catch (ArgumentNullException)
     {
         return(NotFound());
     }
 }
Exemplo n.º 3
0
 public IActionResult Delete(string id)
 {
     try
     {
         docService.Delete(id);
         return(Ok());
     }
     catch (Exception ex)
     {
         logger.LogError(ex.Message);
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }