Beispiel #1
0
        public void PayInstallmentFailInvalid(float a)
        {
            Account credit_card = new Account();

            credit_card.Grant(a);

            Assert.That(() => credit_card.PayInstallment(), Throws.TypeOf <InvalidInstallmentException>());
        }
Beispiel #2
0
        [TestCase(2.5F, 456.7F)] //OFF
        public void WithdrawFromCreditCardFail(float a, float b)
        {
            Account credit_card = new Account();

            credit_card.Grant(a);

            Assert.That(() => credit_card.WithdrawFromCreditCard(b), Throws.TypeOf <NotEnoughFundsException>());
        }
Beispiel #3
0
        public void PayInstallmentFailNoFunds([Values(1, 10)] float a, [Values(900, 1000)] float b)
        {
            Account credit_card = new Account();

            credit_card.Deposit(a);
            credit_card.Grant(1000);
            credit_card.WithdrawFromCreditCard(b);

            Assert.That(() => credit_card.PayInstallment(), Throws.TypeOf <NotEnoughFundsException>());
        }
Beispiel #4
0
 public void InitAccount()
 {
     //arrange
     source = new Account();
     source.Deposit(200.00F);
     destination = new Account();
     destination.Deposit(150.00F);
     credit_card = new Account(); // regular account + credit_balance non-zero
     credit_card.Deposit(500F);
     credit_card.Grant(1000F);
 }
Beispiel #5
0
        [TestCase(999, 1)]                                   //ON
        public void WithdrawFromCreditCard(float a, float b) //WithdrawFromCreditCard nu-i totuna cu Withdraw -> vezi comentariile din clasa Account
        {
            //arrange
            Account credit_card = new Account();

            credit_card.Deposit(500F);
            credit_card.Grant(1000F);

            //act
            credit_card.WithdrawFromCreditCard(a);

            //assert
            Assert.AreEqual(b, credit_card.CreditBalance);
        }