예제 #1
0
파일: ATMTests.cs 프로젝트: tams89/TT.ATM
        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));
            }
        }
예제 #2
0
파일: ATMTests.cs 프로젝트: tams89/TT.ATM
        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);
        }
예제 #3
0
파일: ATMTests.cs 프로젝트: tams89/TT.ATM
 public void CanWithdraw_OnceAuthorised()
 {
     var service = new AccountService();
     Assert.DoesNotThrow(() => service.WithdrawCash(500, 123456, 12345678));
 }
예제 #4
0
파일: ATMTests.cs 프로젝트: tams89/TT.ATM
 public void CannotWithdraw_MoreThan_OneThousandPerDay()
 {
     var service = new AccountService();
     Assert.DoesNotThrow(() => service.WithdrawCash(500, 123456, 12345678));
     Assert.Throws<OverflowException>(() => service.WithdrawCash(500, 123456, 12345678));
 }