Пример #1
0
        public void deleteAccountByValidIdTest()
        {
            BankAccount account      = _bankAccountService.CreateAccount(new BankAccount(100, "TestRef"));
            var         addedAccount = _bankAccountService.GetAccount(account.Id);

            Assert.IsNotNull(addedAccount);
            Assert.AreEqual(account.Id, addedAccount.Id);

            _bankAccountService.DeleteAccount(account.Id);
            var deletedAccount = _bankAccountService.GetAccount(account.Id);

            Assert.IsNull(deletedAccount);
        }
Пример #2
0
        public ActionResult <BankAccountModel> DeleteAccount(string accountId)
        {
            var deletedAccount = _bankAccountService.DeleteAccount(accountId);

            if (deletedAccount == null)
            {
                return(NotFound());
            }
            return(BankAccountModel.FromDomain(deletedAccount));
        }