public void BalanceInquiry__AccountNotFound_Assert_Exception() { Account = new Account(); var stubRepo = new Mock <IAccountRepository>(); IBankDataBaseService bankDataBaseService = new BankDataBaseService(stubRepo.Object); BalanceInquiryService = new BalanceInquiryService(bankDataBaseService); BalanceInquiryService.Execute(27056); }
public void BalanceInquiry_Assert_True() { Account = new Account() { PIN = 90565, Id = 27056, TotalAmount = new Amount("USD", 500), ClientId = 22 }; var stubRepo = new Mock <IAccountRepository>(); stubRepo.Setup(s => s.FindAsync(27056)).ReturnsAsync(Account); IBankDataBaseService bankDataBaseService = new BankDataBaseService(stubRepo.Object); BalanceInquiryService = new BalanceInquiryService(bankDataBaseService); Assert.IsTrue(BalanceInquiryService.Execute(27056) == new Amount("USD", 500)); }
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)); }