public void Withdraw_InsufficientCash_ReturnAtmError() { var atm = new Atm(0); atm.BeginSession(0, 0, 100, 100); var result = atm.WithdrawCash(100); Assert.AreEqual(result, "ATM_ERR"); }
public void Withdraw_InsufficientBalance_ReturnFundsError(int balance, int overdraft, int withdrawalAmount) { var atm = new Atm(int.MaxValue); atm.BeginSession(0, 0, balance, overdraft); var result = atm.WithdrawCash(withdrawalAmount); Assert.AreEqual(result, "FUNDS_ERR"); }
public void Withdraw_IncorrectPin_ReturnAccountError() { var atm = new Atm(int.MaxValue); atm.BeginSession(1111, 0, 1, 1); var result = atm.WithdrawCash(1); Assert.AreEqual(result, "ACCOUNT_ERR"); }
public string Withdraw_HasSufficientBalance_returnRemainingBalance(int balance, int overdraft, int withdrawalAmount) { var atm = new Atm(int.MaxValue); atm.BeginSession(0, 0, balance, overdraft); var result = atm.WithdrawCash(withdrawalAmount); atm.EndSession(); return(result); }
public void Balance_IncorrectPin_ReturnAccountError() { var atm = new Atm(int.MaxValue); atm.BeginSession(1111, 0, 1, 1); var result = atm.GetBalance(); Assert.AreEqual(result, "ACCOUNT_ERR"); }
public string Balance_CorrectPin_ReturnBalance(int balance) { var atm = new Atm(int.MaxValue); atm.BeginSession(1111, 1111, balance, 1); var result = atm.GetBalance(); return(result); }
public void Withdraw_InsufficientBalance_BalanceUnchanged() { var atm = new Atm(int.MaxValue); atm.BeginSession(1111, 1111, 1, 0); atm.WithdrawCash(1000); Assert.AreEqual(atm.GetBalance(), "1"); }
public void Withdraw_MultipleWithdrawals_ReturnRemainingBalance() { var atm = new Atm(int.MaxValue); atm.BeginSession(0, 0, 1000, 0); atm.WithdrawCash(10); var result = atm.WithdrawCash(10); Assert.AreEqual(result, "980"); }
public void Withdraw_SufficientBalance_BalanceUpdated() { var atm = new Atm(int.MaxValue); atm.BeginSession(0, 0, 1, 0); atm.WithdrawCash(1); var result = atm.GetBalance(); Assert.AreEqual(result, "0"); }