Beispiel #1
0
        public void IsMothlyFeeAdded()
        {
            decimal fee1 = 0m;
            decimal fee2 = 0m;


            FeeCalculator    SUT         = new FeeCalculator();
            ITransactionData transaction = new TransactionData()
            {
                Date         = new DateTime(2020, 5, 25),
                MerchantName = "TELIA",
                Fee          = 1.2m
            };

            fee1 = SUT.AddMonthlyFee(transaction);

            transaction.Date = transaction.Date.AddMonths(1);
            transaction.Fee  = 1.2m;
            fee2             = SUT.AddMonthlyFee(transaction);

            Assert.AreEqual(fee1, fee2);


            // Test if monthly fee is added if the basic fee was 0 and now 1.2.
            SUT         = new FeeCalculator();
            transaction = new TransactionData()
            {
                Date         = new DateTime(2020, 5, 25),
                MerchantName = "TELIA",
                Fee          = 0
            };
            fee1 = SUT.AddMonthlyFee(transaction);
            Assert.AreEqual(0m, fee1);

            transaction.Fee  = 1.2m;
            transaction.Date = new DateTime(2020, 5, 26);
            fee2             = SUT.AddMonthlyFee(transaction);
            Assert.AreEqual(30.2m, (fee2 - fee1));
        }