public void TransferMoneyMethodTest() { //Arrange Account accountFrom = new Account { Name = "Tom", AccountNumber = "1234567890", Balance = 35.00m, AccountType = "Checking" }; Account accountTo = new Account { Name = "Dave", AccountNumber = "0987654321", Balance = 732.21m, AccountType = "Savings" }; var accService = new AccountService(new Repository(new DataContext())); //Act accService.TransferMoney(accountFrom, accountTo, 20.0m); var result = accountFrom.Balance; //Assert Assert.AreEqual(result, 15m); }
public AccountDTO OpenAccount(string username, string accountType, decimal startingBalance) { Account newAccount = new Account { AccountType = accountType, Balance = startingBalance, Name = username, AccountNumber = GenerateAccountNumber() }; _repo.Add<Account>(newAccount); _repo.SaveChanges(); return Mapper.Map<AccountDTO>(newAccount); }
public void AdjustBalance(Account account, decimal dollarAmount) { }