Example #1
0
        private static void OtherTestStates()
        {
            BankAccount bankaccount = new BankAccount();
            bankaccount.IdentityConfirmed("1234");
            bankaccount.Credit(1000);
            bankaccount.Credit(1000);
            bankaccount.Debit(1000);
            bankaccount.Freeze();

            //Note: For each test below, uncomment a test and check your results. Then
            //comment out that test and move to the next test.

            //Test #1: Invalid state for debit should throw an exception
            //bankaccount.Debit(1000);

            bankaccount.Unfreeze();

            //Test #2: Account closes properly with zero balance
            //bankaccount.Debit(1000);

            // Test #3 : Overdraws account account can't be closed
            //bankaccount.Debit(2500);

            //Initial run, balance not zero, cuts a check and closes account
            bankaccount.Close();

            //Test #4 : Leave Test #3 uncommented. Credits 1500 and can now close the account
            //bankaccount.Credit(1500);
            //bankaccount.Close();
        }
Example #2
0
 private static void PassTestStates()
 {
     BankAccount bankaccount = new BankAccount();
     bankaccount.IdentityConfirmed("1234");
     bankaccount.Credit(1000);
     bankaccount.Credit(1000);
     bankaccount.Credit(1000);
     bankaccount.Freeze();
     bankaccount.Unfreeze();
     bankaccount.Debit(3000);
     bankaccount.Close();
 }
Example #3
0
 private static void ConfirmingIdentityTest()
 {
     BankAccount bankaccount = new BankAccount();
     bankaccount.IdentityConfirmed("2345");
 }