public void ShippingCompany_Service_Remove_Sucessfully()
        {
            //Arrange
            var shippingCompanyCmd = ObjectMother.ShippingCompanyCommandToRemove();
            var mockWasRemoved     = true;

            _mockShippingCompanyRepository.Setup(e => e.Remove(It.IsAny <int>())).Returns(mockWasRemoved);

            //Action
            var productRemoved = _shippingCompanyService.Remove(shippingCompanyCmd);

            //Verificar
            _mockShippingCompanyRepository.Verify(e => e.Remove(It.IsAny <int>()), Times.Once);
            productRemoved.Should().BeTrue();
        }
Esempio n. 2
0
        public IHttpActionResult Remove(ShippingCompanyRemoveCommand shippingCompany)
        {
            var validador = shippingCompany.Validate();

            if (!validador.IsValid)
            {
                return(HandleValidationFailure(validador.Errors));
            }

            return(HandleCallback(_service.Remove(shippingCompany)));
        }