public void Account_withdraw_without_balance() { //arrange Account a = new Everyday(200); decimal withdrawal = 500; string actual; //act try { actual = a.Withdraw(withdrawal); Assert.Fail(); // will not reach here if correct } catch (Exception e) { actual = e.Message; } string expected = "Everyday " + a.ID.ToString() + "; withdrawal $500; transaction failed; balance $200"; //assert Assert.AreEqual(expected, actual); }
public void Account_get_info_string() { //arrange Account a = new Everyday(1130); //act string expected = "Account " + a.ID.ToString() + "; Balance $1130"; string actual = a.GetInfo(); //assert Assert.AreEqual(expected, actual); }
public void Account_print_as_readable_string() { //arrange Account a = new Everyday(1130); //act string expected = "Everyday " + a.ID.ToString(); string actual = a.ToString(); //assert Assert.AreEqual(expected, actual); }
public void Account_deposit_to_balance() { //arrange Account a = new Everyday(1000); //act a.Deposit(200); //assert decimal expected = 1200; decimal actual = a.Balance; Assert.AreEqual(expected, actual); }
public void Account_withdraw_with_balance() { //arrange Account a = new Everyday(1000); decimal withdrawal = 200; //act a.Withdraw(withdrawal); //assert decimal expected = 800; decimal actual = a.Balance; Assert.AreEqual(expected, actual); }
public void Account_create_with_balance() { //arrange Account a = new Everyday(1130); //act //assert decimal expected = 1130; decimal actual = a.Balance; Assert.AreEqual(expected, actual); }