Exemplo n.º 1
0
        public IHttpActionResult Delete(CheckingAccountRemoveCommand cmd)
        {
            var validator = cmd.Validate();

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

            return(HandleCallback(() => _accountsService.Remove(cmd)));
        }
Exemplo n.º 2
0
        public void CheckingAccounts_Service_Delete_Should_Be_OK()
        {
            //Arrange
            var returns = true;

            _mockRepositoryAccount.Setup(r => r.Remove(_checkingAccount))
            .Returns(returns);
            _mockRepositoryAccount.Setup(r => r.GetById(_checkingAccount.Id)).Returns(_checkingAccount);

            //Action
            var idInsert = _service.Remove(_checkingAccountRemove);

            //Verify
            idInsert.Should().Be(returns);
            _mockRepositoryAccount.Verify(r => r.Remove(It.IsAny <CheckingAccount>()));
            _mockRepositoryAccount.Verify(r => r.GetById(It.IsAny <long>()));
        }
Exemplo n.º 3
0
 public IHttpActionResult Delete(CheckingAccount account)
 {
     return(HandleCallback(() => _accountsService.Remove(account)));
 }