예제 #1
0
        public void FeeFirstMonthApplied0Fee_Success()
        {
            var provider = new TestTransactionProvider(TestTransactionsWithoutFee);
            var consumer = new TestTransactionConsumer();

            var manager = new TransactionManager(provider, consumer);

            manager.AddRule(new InvoiceFixedFeeRule(20));

            manager.ProcessTransactions();

            Assert.IsTrue(consumer.Transactions.TrueForAll(t => t.Fee == 0m));
        }
예제 #2
0
        public void FeeFirstMonthApplied_Success()
        {
            var provider = new TestTransactionProvider(TestTransactionsWithFee);
            var consumer = new TestTransactionConsumer();

            var manager = new TransactionManager(provider, consumer);

            manager.AddRule(new InvoiceFixedFeeRule(20));

            manager.ProcessTransactions();

            var fees = consumer.Transactions.Select(t => t.Fee).ToList();

            CollectionAssert.AreEqual(new List <decimal> {
                40m, 40m, 20m, 40m, 20m
            }, fees);
        }