public void Delete() { _repository.Setup(r => r.Contains(1)).Returns(true); _repository.Setup(r => r.Delete(1)); var response = _controller.Delete(1) as NoContentResult; Assert.Equal(204, response.StatusCode); _operationCounter.Verify(oc => oc.Increment(TrackedOperation.Delete), Once); }
public void Delete() { _repository.Setup(r => r.Contains(1)).Returns(true); _repository.Setup(r => r.Delete(1)); var response = _controller.Delete(1); Assert.IsType <NoContentResult>(response); var typedResponse = response as NoContentResult; Assert.Equal(204, typedResponse.StatusCode); }
public void Delete() { _repository.Setup(r => r.Contains(1)).Returns(true); _repository.Setup(r => r.Delete(1)); var response = _controller.Delete(1); Assert.IsType <NoContentResult>(response); var typedResponse = response as NoContentResult; Assert.Equal(204, typedResponse.StatusCode); _operationTimeEntry.Verify(ot => ot.Increment(TrackedOperation.Delete), Times.Once); }