Beispiel #1
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 #2
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 #3
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);
        }