private Account CreateAccount(AccountType accountType, string accountName, int accountId, ForeignCurrency currency = null) { var result = AccountBuilder.Create(accountName) .WithId(accountId) .WithAccountType(accountType) .WithForeignCurrency(currency) .Build(); Workspace.Add(result); Workspace.CommitChanges(); return(result); }
public void CanCreateCashAccount() { var accountType = AccountTypeBuilder.Create("Payment Accounts").Build(); Workspace.Add(accountType); var account = AccountBuilder.Create("Cash").WithAccountType(accountType).Build(); Workspace.Add(account); Workspace.CommitChanges(); var balance = AccountService.GetAccountBalance(account.Id); Assert.AreEqual(0, balance); }