Ejemplo n.º 1
0
        public void Calculate2018MarginalTaxRateFees(decimal Balance, decimal Expected)
        {
            var strategy = new MarginalFeeStrategy()
            {
                Amount    = Balance,
                RateSteps = new List <RateStep> {
                    new RateStep {
                        Rate = 10M, LowerLimit = 0, UpperLimit = 19050M
                    },                                                           // 1905
                    new RateStep {
                        Rate = 12M, LowerLimit = 19051.00M, UpperLimit = 77400.00M
                    },                                                                      // 7001.88
                    new RateStep {
                        Rate = 22M, LowerLimit = 77401M, UpperLimit = 165000M
                    },
                    new RateStep {
                        Rate = 24M, LowerLimit = 165001M, UpperLimit = 315000M
                    },
                    new RateStep {
                        Rate = 32M, LowerLimit = 315001M, UpperLimit = 400000M
                    },
                    new RateStep {
                        Rate = 32M, LowerLimit = 400001M, UpperLimit = 600000M
                    },
                    new RateStep {
                        Rate = 32M, LowerLimit = 600001M, UpperLimit = null
                    }
                }
            };
            var Result = strategy.Calculate(Balance);

            Assert.Equal(Expected, Result);
        }
Ejemplo n.º 2
0
        public void CalculateMarginalRateFees(decimal Balance, decimal Expected)
        {
            var strategy = new MarginalFeeStrategy()
            {
                Amount    = Balance,
                RateSteps = new List <RateStep> {
                    new RateStep {
                        Rate = 10M, LowerLimit = 0, UpperLimit = 100.00M
                    },
                    new RateStep {
                        Rate = 20M, LowerLimit = 100M, UpperLimit = 500.00M
                    },
                    new RateStep {
                        Rate = 30M, LowerLimit = 500M, UpperLimit = null
                    }
                }
            };
            var Result = strategy.Calculate(Balance);

            Assert.Equal(Expected, Result);
        }