コード例 #1
0
        public void Delete_ShouldDeleteConstructionBolt()
        {
            // Arrange
            int id = _rnd.Next(1, _constructionBolts.Count());

            // Act
            _service.Delete(id);

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