public void ShouldAddWithdrawHistory() { TransactionHistory transactionHistory = new TransactionHistory(1000); transactionHistory.WithdrawTransaction(100, 900); Assert.Equal("Starting balance is 1000\nWithdraw: 100\nCurrent balance is 900\n", transactionHistory.history); }
public void WithdrawMoney(double amount) { if (balance > amount) { balance -= amount; transactionHistory.WithdrawTransaction(amount, balance); } else if (balance < amount) { throw new Exception("whoops, you do not own that much money"); } else { throw new Exception("whoops, Invalid Input"); } }