Beispiel #1
0
        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
        }
Beispiel #2
0
        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
        }
Beispiel #3
0
        public void TestGetAllAccounts_GetAccountsWhenNoAccounts_EmptyList()
        {
            #region Arrange
            Customer customer = new Customer("Sven Svensson");
            #endregion

            #region Act
            int result = customer.GetAllAccounts().Count;
            int expected = 0;
            #endregion

            #region Assert
            Assert.AreEqual(expected, result);
            #endregion
        }
Beispiel #4
0
        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
        }