public void WithdrawalServiceUTest_AccountNotFound_Assert_Exception() { Account = new Account(); var stubRepo = new Mock <IAccountRepository>(); IBankDataBaseService bankDataBaseService = new BankDataBaseService(stubRepo.Object); WithdrawalService = new WithdrawalService(bankDataBaseService, stubRepo.Object); WithdrawalService.Execute(27056, new Amount("USD", 1100)); }
public void WithdrawalServiceUTest_Assert_False() { Account = new Account() { PIN = 90565, Id = 27056, TotalAmount = new Amount("USD", 600), ClientId = 22 }; var stubRepo = new Mock <IAccountRepository>(); stubRepo.Setup(s => s.FindAsync(27056)).ReturnsAsync(Account); IBankDataBaseService bankDataBaseService = new BankDataBaseService(stubRepo.Object); WithdrawalService = new WithdrawalService(bankDataBaseService, stubRepo.Object); BalanceInquiryService = new BalanceInquiryService(bankDataBaseService); WithdrawalService.Execute(Account.Id, new Amount("USD", 100)); Assert.IsFalse(BalanceInquiryService.Execute(27056) == new Amount("USD", 100)); }