public void CheckingAbleToWithDraw() { CheckingAccount ca = new CheckingAccount(2000); ca.WithDrawMoney(1000); Assert.AreEqual(1000, ca.Balance); }
public void CheckingAbleToDeposit() { CheckingAccount ca = new CheckingAccount(0); ca.DepositMoney(1000); Assert.AreEqual(1000, ca.Balance); }
public void CheckingAbleToOverDraw() { CheckingAccount ca = new CheckingAccount(100); bool result = ca.WithDrawMoney(1000); Assert.IsTrue(result); Assert.AreEqual(-900, ca.Balance); }
protected CheckingAccount GetNewCheckingAccountWHighBalance() { CheckingAccount newCheckingAccountWHighBalance = new CheckingAccount(70000); newCheckingAccountWHighBalance.SnapShotDailyBalance(); newCheckingAccountWHighBalance.Deposit(60000); newCheckingAccountWHighBalance.SnapShotDailyBalance(); return newCheckingAccountWHighBalance; }
public void CheckingAbleToTransferFunds() { CheckingAccount ca = new CheckingAccount(1200); CheckingAccount ca2 = new CheckingAccount(0); ca.TransferMoney(ca2, 1000); Assert.AreEqual(200, ca.Balance); Assert.AreEqual(1000, ca2.Balance); }
protected CheckingAccount GetOldCheckingAccountWHighBalance() { CheckingAccount oldCheckingAccountWHighBalance = new CheckingAccount(70000, new DateTime(DateTime.Now.AddYears(-7).Ticks)); oldCheckingAccountWHighBalance.SnapShotDailyBalance(); oldCheckingAccountWHighBalance.Deposit(60000); oldCheckingAccountWHighBalance.SnapShotDailyBalance(); return oldCheckingAccountWHighBalance; }
static void Main(string[] args) { SavingAccount a = new SavingAccount("Meher", 100.00, 100005); Console.WriteLine("Saving Account"); a.AddBalance(100); a.Interest(); a.Withdraw(50.0); a.ShowBalance(); CheckingAccount b = new CheckingAccount("Hridoy", 250.0, 500010); Console.WriteLine("Checking Account"); b.AddBalance(600.0); b.OrderCheck(); b.Withdraw(100.0); b.ShowBalance(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); SavingsAccount savings = new SavingsAccount(500.00M); savings.Deposit(100M); savings.Withdraw(50M); // Mess with checking CheckingAccount checking = new CheckingAccount(); checking.Deposit(500M); checking.Withdraw(1000M); checking.Withdraw(100M); Console.ReadLine(); }
public BankAccount CreateBankAccount(string newAccount) // Lägger upp ett konto åt kund { BankAccount createBankAccount; if (newAccount.Equals("CheckingAccount")) { createBankAccount = new CheckingAccount(); } else if (newAccount.Equals("RetiermentAccount")) { createBankAccount = new RetiermentAccount(); } else { createBankAccount = new SavingsAccount(); } return(createBankAccount); }
private void MakeAccount() { foreach (var c in customerList.Customers) { if (comboCustomers.SelectedItem.Equals(c.GetFullName())) { if ((rbtnC.IsChecked == true) && (boxCredit.Text != "")) { int banknumber = c.AccountNumber(); checkingAccount = new CheckingAccount(int.Parse(boxCredit.Text)); c.AddBankAccount(checkingAccount); checkingAccount.AddAccountNumber(banknumber); MessageBox.Show("Du har skapat ett lönekonto!"); } if (rbtnR.IsChecked == true) { int banknumber = c.AccountNumber(); retirementAccount = new RetirementAccount(); c.AddBankAccount(retirementAccount); retirementAccount.AddAccountNumber(banknumber); MessageBox.Show("Du har skapat ett pensionsspar!"); } if (rbtnS.IsChecked == true) { int banknumber = c.AccountNumber(); savingAccount = new SavingAccount(); c.AddBankAccount(savingAccount); savingAccount.AddAccountNumber(banknumber); MessageBox.Show("Du har skapat ett sparkonto!"); } } } }