Пример #1
0
        public void Snack_Service_Should_Remove_Snack_Sucessfully()
        {
            //Arrange
            var idToRemove     = 1;
            var mockWasRemoved = true;

            _mockSnackRepository.Setup(e => e.Save()).Returns(mockWasRemoved);

            //Action
            var removed = _snackService.Remove(idToRemove);

            //Assert
            _mockSnackRepository.Verify(e => e.Remove(idToRemove), Times.Once);
            removed.Should().BeTrue();
        }
Пример #2
0
 public IHttpActionResult Delete([FromBody] long id)
 {
     return(HandleCallback(_service.Remove(id)));
 }