public void Delete_ShouldDeleteConstructionElement() { // Arrange int id = _rnd.Next(1, _constructionElements.Count()); // Act _service.Delete(id); // Assert _repository.Verify(mock => mock.Delete( It.IsAny <ConstructionElement>()), Times.Once); }
public ActionResult Delete(int id) { try { _service.Delete(id); return(NoContent()); } catch (ArgumentNullException) { return(NotFound()); } }