public void createAccountTest() { BankManager target = new BankManager(); // TODO: Initialize to an appropriate value bool expected = true; // TODO: Initialize to an appropriate value bool actual; actual = target.createAccount(); Assert.AreEqual(expected, actual); Assert.IsTrue(expected, "Create account returned new account"); Assert.IsFalse(!expected, "ERROR: Create account failed to return a new account"); }
public void displayAccountTest() { BankManager target = new BankManager(); // TODO: Initialize to an appropriate value bool createAccount = target.createAccount(); if (!createAccount) Assert.IsFalse(!createAccount, "ERROR! Could not create account."); Console.WriteLine("Successfully created account."); bool expected = true; // TODO: Initialize to an appropriate value bool actual; actual = target.displayAccount(); Assert.AreEqual(expected, actual); Assert.IsTrue(expected, "Display account successfully displayed account"); Assert.IsFalse(!expected, "ERROR: Display account failed to display account"); }
public void updateAccountTest() { BankManager target = new BankManager(); // TODO: Initialize to an appropriate value bool createAccount = target.createAccount(); if (!createAccount) Assert.IsFalse(!createAccount, "ERROR! Could not create account."); Console.WriteLine("Successfully created account."); target.NumberAccounts++; bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = target.updateAccount(); try { Assert.AreEqual(expected, actual); Assert.IsTrue(expected, "Account update successful."); Assert.IsFalse(!expected, "Account update teriminated with error."); } catch (Exception e) { } }
public void findAccountTest() { BankManager target = new BankManager(); // TODO: Initialize to an appropriate value // Create an account with accountNumber = 0 bool createAccount = target.createAccount(); if (!createAccount) Assert.IsFalse(!createAccount, "ERROR! Could not create account."); Console.WriteLine("Successfully created account."); int expected = 0; // TODO: Initialize to an appropriate value int actual; actual = target.findAccount(); Assert.AreEqual(expected, actual); Assert.IsTrue((expected == actual), "Find account successfully found account."); Assert.IsFalse((expected != actual), "Find account unable to find account."); }