Example #1
0
        public static IncomeTaxTableEntry CreateWith(decimal minThreshold,
                                                     decimal maxThreshold,
                                                     decimal accumulatedTaxFromPreviousBracket,
                                                     decimal marginalTaxRate)
        {
            EnsureValidValues(minThreshold, maxThreshold);

            var incomeThreshold = CalculateIncomeThreshold(minThreshold);
            var taxBracket      = new IncomeTaxBracket(accumulatedTaxFromPreviousBracket, marginalTaxRate, incomeThreshold);
            var taxTableEntry   = new IncomeTaxTableEntry(minThreshold, maxThreshold, taxBracket);

            return(taxTableEntry);
        }
 private static decimal CalcualteMarginalTaxableAmount(decimal yearlyTaxableIncome, IncomeTaxBracket incomeTaxBracket)
 {
     return(yearlyTaxableIncome - incomeTaxBracket.IncomeThreshold);
 }
Example #3
0
 private IncomeTaxTableEntry(decimal minThreshold, decimal maxThreshold, IncomeTaxBracket incomeTaxBracket)
 {
     _minThreshold    = minThreshold;
     _maxThreshold    = maxThreshold;
     IncomeTaxBracket = incomeTaxBracket;
 }
        private static decimal CalculateMarginalTax(decimal yearlyTaxableIncome, IncomeTaxBracket incomeTaxBracket)
        {
            var marginalTaxableAmount = CalcualteMarginalTaxableAmount(yearlyTaxableIncome, incomeTaxBracket);

            return(marginalTaxableAmount * incomeTaxBracket.MarginalTaxRate);
        }