public void TestAddAccount_AddTwoAccountsWithUniqueNames_TwoAccountsInListAndTrue() { #region Arrange Customer customer = new Customer("Sven Svensson"); Account account = new Account("Savings", 6500, false); Account accountTwo = new Account("Poker winnings", 3100, false); #endregion #region Act bool result = customer.AddAccount(account); bool expected = true; bool resultTwo = customer.AddAccount(accountTwo); bool expectedTwo = true; int resultThree = customer.GetAllAccounts().Count; int expectedThree = 2; #endregion #region Assert Assert.AreEqual(expected, result); Assert.AreEqual(expectedTwo, resultTwo); Assert.AreEqual(expectedThree, resultThree); #endregion }
public void TestAddAccount_AddOneAccount_OneAccountInListAndTrue() { #region Arrange Customer customer = new Customer("Sven Svensson"); Account account = new Account("Savings", 250, false); List<Account> accountList = new List<Account>(); #endregion #region Act accountList = customer.GetAllAccounts(); bool result = customer.AddAccount(account); bool expected = true; int resultTwo = accountList.Count; int expectedTwo = 1; #endregion #region Assert Assert.AreEqual(expected, result); Assert.AreEqual(expectedTwo, resultTwo); #endregion }
public void TestGetAllAccounts_GetAccountsWhenTwoAccounts_ListWithTwoAccounts() { #region Arrange Customer customer = new Customer("Sven Svensson"); Account accountOne = new Account("Poker winnings", 6500, false); Account accountTwo = new Account("Stryktipset winnings", 14500, false); customer.AddAccount(accountOne); customer.AddAccount(accountTwo); #endregion #region Act int result = customer.GetAllAccounts().Count; int expected = 2; #endregion #region Assert Assert.AreEqual(expected, result); #endregion }
public void TestGetSpecificAccount_GetSpecificAccountWhenNameMatches_SpecificAccountWithMatchingName() { #region Arrange Customer customer = new Customer("Per Persson"); Account account = new Account("Poker winnings", 6500, false); customer.AddAccount(account); #endregion #region Act Account matchingAccount = customer.GetSpecificAccount("Poker winnings"); string result = matchingAccount.GetAccountName(); string expected = "Poker winnings"; #endregion #region Assert Assert.AreEqual(expected, result); #endregion }
public BankHandler() { theCustomer = new Customer("Customer"); initialAccount = new Account("Vacation savings", 7700.50, false); theCustomer.AddAccount(initialAccount); }