public void Cannot_CarryOut_MoreThanTenTransactionsPerDay() { var service = new AccountService(); for (var i = 0; i < 10; i++) { if (i < 9) Assert.DoesNotThrow(() => service.WithdrawCash(1, 123456, 12345678)); else Assert.Throws<OverflowException>(() => service.WithdrawCash(1, 123456, 12345678)); } }
public void CanSeePastFiveTransactions_OnceAuthorised() { var service = new AccountService(); for (var i = 0; i < 5; i++) { service.WithdrawCash(1, 123456, 12345678); } var data = service.GetTransactions(123456, 12345678); Assert.IsTrue(data.Count == 5); }
public void CanWithdraw_OnceAuthorised() { var service = new AccountService(); Assert.DoesNotThrow(() => service.WithdrawCash(500, 123456, 12345678)); }
public void CannotWithdraw_MoreThan_OneThousandPerDay() { var service = new AccountService(); Assert.DoesNotThrow(() => service.WithdrawCash(500, 123456, 12345678)); Assert.Throws<OverflowException>(() => service.WithdrawCash(500, 123456, 12345678)); }