示例#1
0
        public void Should_return_TaxingEngine2015_for_DefaultEngine_when_Year_2015()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine2015 = engines.DefaultEngine();

            Assert.AreEqual(FULL_CLASS_NAME_2015, engine2015.GetType().ToString());
        }
示例#2
0
        private EngineServiceModule()
        {
            HistoryOfPeriod = PeriodEnginesHistory.CreateEngines();

            HistoryOfTaxing = TaxingEnginesHistory.CreateEngines();

            HistoryOfHealth = HealthEnginesHistory.CreateEngines();

            HistoryOfSocial = SocialEnginesHistory.CreateEngines();
        }
示例#3
0
        public void Should_return_Minimum_Constants_for_Taxing_Engine_when_Year_2015()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            Assert.AreEqual(50, engine.PeriodMinimumValidAmountOfTaxBonus(testPeriod));
            Assert.AreEqual(8500, engine.PeriodMinimumIncomeRequiredForTaxBonus(testPeriod));
            Assert.AreEqual(103768, engine.PeriodMinimumIncomeToApplySolidaryIncrease(testPeriod));
        }
示例#4
0
        public void Should_return_Factor_Constants_for_Taxing_Engine_when_Year_2015()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            Assert.AreEqual(15.0m, engine.PeriodAdvancesFactor(testPeriod));
            Assert.AreEqual(15.0m, engine.PeriodWithholdFactor(testPeriod));
            Assert.AreEqual(7.0m, engine.PeriodSolidaryFactor(testPeriod));
        }
示例#5
0
        public void Should_return_TaxingEngine2011_for_ClassNameEngine_when_Year_2011()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            MonthPeriod period2011 = new MonthPeriod(2011, 1);

            ITaxingEngine engine2011 = engines.ResolveEngine(period2011);

            Assert.AreEqual(FULL_CLASS_NAME_2011, engine2011.GetType().ToString());
        }
示例#6
0
        public void Should_return_Maximum_Constants_for_Taxing_Engine_when_Year_2015()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            Assert.AreEqual(5025, engine.PeriodMaximumValidAmountOfTaxBonus(testPeriod));
            Assert.AreEqual(100, engine.PeriodMaximumIncomeToApplyRoundingToSingles(testPeriod));
            Assert.AreEqual(10000, engine.PeriodMaximumIncomeToApplyWithholdTax(testPeriod));
        }
示例#7
0
        public void Should_return_1500_for_Regulary_Tax_when_Regulary_Basis_is_10_000_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            decimal testIncome = 10000m;

            decimal resultValue = engine.WithholdResultTax(testPeriod, testIncome);

            Assert.AreEqual(1500m, resultValue);
        }
示例#8
0
        public void Should_return_17_467_for_Regulary_Tax_when_Income_is_116_444_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            decimal testIncome = 116444m;

            decimal resultValue = engine.WithholdResultTax(testPeriod, testIncome);

            Assert.AreEqual(17467m, resultValue);
        }
示例#9
0
        public void Should_return_200_for_Withhold_Basis_when_Income_is_100_01()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            decimal testIncome = 100.01m;

            decimal resultValue = engine.WithholdRoundedBasis(testPeriod, testIncome);

            Assert.AreEqual(101, resultValue);
        }
        public void Should_return_0_for_Solidary_Basis_when_Income_is_106_443_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            decimal testIncome = 106443m;

            decimal resultValue = engine.AdvancesSolidaryBasis(testPeriod, testIncome);

            Assert.AreEqual(0m, resultValue);
        }
        public void Should_return_100_for_Advances_Basis_when_Income_is_100_00()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            decimal testIncome = 100.00m;

            decimal resultValue = engine.AdvancesRoundedBasis(testPeriod, testIncome);

            Assert.AreEqual(100, resultValue);
        }
示例#12
0
        private CountryServiceModule()
        {
            Assembly serviceModuleAssembly = this.GetType().Assembly;

            HistoryOfEmploy = EmployEnginesHistory.CreateEngines(serviceModuleAssembly);

            HistoryOfTaxing = TaxingEnginesHistory.CreateEngines(serviceModuleAssembly);

            HistoryOfHealth = HealthEnginesHistory.CreateEngines(serviceModuleAssembly);

            HistoryOfSocial = SocialEnginesHistory.CreateEngines(serviceModuleAssembly);
        }
        public void Should_return_335_for_Study_Allowance_when_Signed_Declaration_and_Residet_CZECH()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testStatementSigned = true;

            Int32 resultValue = engine.StatementPayerStudyAllowance(testPeriod,
                                                                    testStatementSigned);

            Assert.AreEqual(335, resultValue);
        }
        public void Should_return_2500_for_Social_Increase_when_Income_is_10_000_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testAdvancesTaxing = true;

            decimal testIncome = 10000m;

            decimal resultValue = engine.AdvancesTaxableSocial(testPeriod, testAdvancesTaxing, testIncome);

            Assert.AreEqual(2500m, resultValue);
        }
        public void Should_return_540_for_Health_Increase_when_Income_is_6_003_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testAdvancesTaxing = true;

            decimal testIncome = 6003m;

            decimal resultValue = engine.AdvancesTaxableHealth(testPeriod, testAdvancesTaxing, testIncome);

            Assert.AreEqual(540m, resultValue);
        }
示例#16
0
        public void Should_return_900_for_Health_Increase_when_Income_is_10_000_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testWithholdTaxing = true;

            decimal testIncome = 10000m;

            decimal resultValue = engine.WithholdTaxableHealth(testPeriod, testWithholdTaxing, testIncome);

            Assert.AreEqual(900m, resultValue);
        }
示例#17
0
        public void Should_return_1501_for_Social_Increase_when_Income_is_6_003_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testWithholdTaxing = true;

            decimal testIncome = 6003m;

            decimal resultValue = engine.WithholdTaxableSocial(testPeriod, testWithholdTaxing, testIncome);

            Assert.AreEqual(1501m, resultValue);
        }
示例#18
0
        public void Should_return_1000_for_Advances_Selector_when_Income_is_1000_and_Advances_Taxing_is_True()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testAdvancesTaxing = true;

            decimal testIncome = 1000m;

            decimal resultValue = engine.AdvancesTaxSelector(testPeriod,
                                                             testAdvancesTaxing, testIncome);

            Assert.AreEqual(1000m, resultValue);
        }
示例#19
0
        public void Should_return_Zero_for_Withhold_Selector_when_Income_is_1000_and_Withhold_Taxing_is_False()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testWithholdTaxing = false;

            decimal testIncome = 1000m;

            decimal resultValue = engine.WithholdTaxSelector(testPeriod,
                                                             testWithholdTaxing, testIncome);

            Assert.AreEqual(0, resultValue);
        }
        public void Should_return_2070_for_Basic_Allowance_when_Signed_Declaration_and_Residet_FOREIGN()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testStatementSigned = true;

            bool testResidentFOREIGN = false;

            Int32 resultValue = engine.StatementPayerBasicAllowance(testPeriod,
                                                                    testStatementSigned, testResidentFOREIGN);

            Assert.AreEqual(2070, resultValue);
        }
        public void Should_return_210_for_Disablement_Allowance_when_Signed_Declaration_and_Residet_CZECH()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testStatementSigned = true;

            byte testDisablementDegree = TaxingGuides.ALLOWANCE_DISAB_DEGREE_1ST;

            Int32 resultValue = engine.StatementPayerDisabAllowance(testPeriod,
                                                                    testStatementSigned, testDisablementDegree);

            Assert.AreEqual(210, resultValue);
        }
        public void Should_return_18_175_for_Regulary_Tax_when_Income_is_116_444_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            decimal testIncome = 116444m;

            decimal testRegulary = 116500m;

            decimal testSolidary = 10000m;

            decimal resultValue = engine.AdvancesResultTax(testPeriod, testIncome, testRegulary, testSolidary);

            Assert.AreEqual(18175m, resultValue);
        }
示例#23
0
		public void Should_return_Zero_for_Taxing_Selector_when_Income_is_1000_and_Select_Article_is_False()
		{ 
			IEnginesHistory<ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines ();

			ITaxingEngine engine = engines.ResolveEngine (testPeriod);

			bool testInsSubject = true;

			bool testInsArticle = false;

			decimal testIncome = 1000m;

			decimal resultValue = engine.SubjectTaxingSelector(testPeriod, 
				testInsSubject, testInsArticle, testIncome);

			Assert.AreEqual(  0, resultValue);
		}
        public void Should_return_335_for_Children_Allowance_when_Signed_Declaration_and_Residet_CZECH()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            bool testStatementSigned = true;

            bool testDisablement = false;

            byte testAllowanceRank = TaxingGuides.ALLOWANCE_CHILDREN_RANK_1ST;

            Int32 resultValue = engine.StatementChildrenAllowance(testPeriod,
                                                                  testStatementSigned, testAllowanceRank, testDisablement);

            Assert.AreEqual(1117, resultValue);
        }
        public void Should_return_2070_for_Tax_Rebate_when_Advances_Tax_is_2071_and_Allowances_Value_is_2070_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            Int32 testAdvancesTax = 2071;

            Int32 testAllowancePayer = 2070;

            Int32 testAllowanceZeros = 0;

            Int32 resultValue = engine.StatementPayerTaxRebate(testPeriod,
                                                               testAdvancesTax, testAllowancePayer, testAllowanceZeros, testAllowanceZeros);

            Assert.AreEqual(2070, resultValue);
        }
        public void Should_return_1117_for_Tax_Rebate_when_Advances_Tax_is_3188_and_Allowances_Value_is_2070_210_335_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            Int32 testAdvancesTax = 3188;

            Int32 testRebatePayer = 2070;

            Int32 testAllowanceChild = 1117;

            Int32 resultValue = engine.StatementChildrenRebate(testPeriod,
                                                               testAdvancesTax, testRebatePayer, testAllowanceChild);

            Assert.AreEqual(1117, resultValue);
        }
        public void Should_return_2615_for_Tax_Rebate_when_Advances_Tax_is_2616_and_Allowances_Value_is_2070_210_335_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            Int32 testAdvancesTax = 2616;

            Int32 testAllowancePayer = 2070;

            Int32 testAllowanceDisab = 210;

            Int32 testAllowanceStudy = 335;

            Int32 resultValue = engine.StatementPayerTaxRebate(testPeriod,
                                                               testAdvancesTax, testAllowancePayer, testAllowanceDisab, testAllowanceStudy);

            Assert.AreEqual(2615, resultValue);
        }
示例#28
0
        public void Should_return_TRUE_for_Taxing_Withhold_when_Non_Signed_Declaration_and_WorkTerm_is_StatutoryTerm_and_Resident_Foreign()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfIncome = WorkRelationTerms.WORKTERM_STATUTORY__Q;

            bool testStatementSigned = false;

            decimal testContractIncome = 0m;
            decimal testWorkTermIncome = 0m;
            decimal testTotalTaxIncome = 0m;

            bool resultValue = engine.WithholdTaxableIncome(testPeriod,
                                                            testStatementSigned, TAX_RESIDENT_NO_CZ, termOfIncome,
                                                            testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(true, resultValue);
        }
示例#29
0
        public void Should_return_TRUE_for_Taxing_Advances_when_Non_Signed_Declaration_and_WorkTerm_is_AgreementTasks_and_Income_is_10_000_CZK()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfIncome = WorkRelationTerms.WORKTERM_CONTRACTER_T;

            bool testStatementSigned = false;

            decimal testContractIncome = 0m;
            decimal testWorkTermIncome = 10000m;
            decimal testTotalTaxIncome = 10000m;

            bool resultValue = engine.AdvancesTaxableIncome(testPeriod,
                                                            testStatementSigned, TAX_RESIDENT_CZECH, termOfIncome,
                                                            testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(true, resultValue);
        }
示例#30
0
        public void Should_return_Allowance_Constants_for_Taxing_Engine_when_Year_2015()
        {
            IEnginesHistory <ITaxingEngine> engines = TaxingEnginesHistory.CreateEngines();

            ITaxingEngine engine = engines.ResolveEngine(testPeriod);

            Assert.AreEqual(2070, engine.PeriodPayerBasicAllowance(testPeriod));
            Assert.AreEqual(210, engine.PeriodDisabilityDgr1Allowance(testPeriod));
            Assert.AreEqual(420, engine.PeriodDisabilityDgr2Allowance(testPeriod));
            Assert.AreEqual(1345, engine.PeriodDisabilityDgr3Allowance(testPeriod));
            Assert.AreEqual(335, engine.PeriodStudyingAllowance(testPeriod));
            Assert.AreEqual(1117, engine.PeriodChildrenRank1stAllowance(testPeriod));
            Assert.AreEqual(1117, engine.PeriodChildrenRank2ndAllowance(testPeriod));
            Assert.AreEqual(1117, engine.PeriodChildrenRank3rdAllowance(testPeriod));
            Assert.AreEqual(1117, engine.PeriodChildrenAllowance(testPeriod, TaxingGuides.ALLOWANCE_CHILDREN_RANK_1ST, false));
            Assert.AreEqual(2234, engine.PeriodChildrenAllowance(testPeriod, TaxingGuides.ALLOWANCE_CHILDREN_RANK_1ST, true));
            Assert.AreEqual(1117, engine.PeriodChildrenAllowance(testPeriod, TaxingGuides.ALLOWANCE_CHILDREN_RANK_2ND, false));
            Assert.AreEqual(2234, engine.PeriodChildrenAllowance(testPeriod, TaxingGuides.ALLOWANCE_CHILDREN_RANK_2ND, true));
            Assert.AreEqual(1117, engine.PeriodChildrenAllowance(testPeriod, TaxingGuides.ALLOWANCE_CHILDREN_RANK_3RD, false));
            Assert.AreEqual(2234, engine.PeriodChildrenAllowance(testPeriod, TaxingGuides.ALLOWANCE_CHILDREN_RANK_3RD, true));
        }