Example #1
0
 public void TestDeposit()
 {
     BankAccount testAccount = new BankAccount("Hello", "Test", 100);
     testAccount.Deposit(100);
     testAccount.Deposit(100);
     Assert.AreEqual(testAccount.Balance, 200);
 }
Example #2
0
        public void TestTransactionHistory()
        {
            BankAccount testAccount = new BankAccount("Hello", "Test", 1000);
            testAccount.Deposit(1000);
            testAccount.Withdraw(100);
            testAccount.Withdraw(100);
            testAccount.Deposit(1000);
            testAccount.Withdraw(100);
            testAccount.Withdraw(100);

            Assert.AreEqual(testAccount.Balance, 1600);
            CollectionAssert.AreEqual(testAccount.TransactionHistory, new List<double>() {1000, -100, -100, 1000, -100, -100});

        }
Example #3
0
        static void Main()
        {

            try
            {

            BankAccount b = new BankAccount("Hello", "Test", 100.50);
            b.Deposit(200);
            b.Deposit(200);
            b.Withdraw(100);

            Console.WriteLine(b);
            Console.ReadKey();

            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
                Console.ReadKey();
            }
        }
Example #4
0
 public void TestOverdraft()
 {
     BankAccount testAccount = new BankAccount("Hello", "Test", -100);
 }