Exemplo n.º 1
0
        public void Should_return_HealthEngine2015_for_DefaultEngine_when_Year_2015()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine2015 = engines.DefaultEngine();

            Assert.AreEqual(FULL_CLASS_NAME_2015, engine2015.GetType().ToString());
        }
        public void Should_return_Factor_Constants_for_Health_Engine_when_Year_2013()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            Assert.AreEqual(13.5m, engine.PeriodCompoundFactor(testPeriod));
        }
        public void Should_return_Maximum_Constants_for_Health_Engine_when_Year_2013()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            Assert.AreEqual(0, engine.PeriodMaximumAnnualBasis(testPeriod));
        }
Exemplo n.º 4
0
        public ICountryProfile BuildCountryProfile(Period period)
        {
            IEmployEngine periodEngine = HistoryOfEmploy.ResolveEngine(period);
            ITaxingEngine taxingEngine = HistoryOfTaxing.ResolveEngine(period);
            IHealthEngine healthEngine = HistoryOfHealth.ResolveEngine(period);
            ISocialEngine socialEngine = HistoryOfSocial.ResolveEngine(period);

            return(new CountryProfile(period, periodEngine, taxingEngine, healthEngine, socialEngine));
        }
Exemplo n.º 5
0
        public IEngineProfile BuildEngineProfile(MonthPeriod period)
        {
            IPeriodEngine periodEngine = HistoryOfPeriod.ResolveEngine(period);
            ITaxingEngine taxingEngine = HistoryOfTaxing.ResolveEngine(period);
            IHealthEngine healthEngine = HistoryOfHealth.ResolveEngine(period);
            ISocialEngine socialEngine = HistoryOfSocial.ResolveEngine(period);

            return(new EngineProfile(period, periodEngine, taxingEngine, healthEngine, socialEngine));
        }
        public void Should_return_Minimum_Constants_for_Health_Engine_when_Month_12_2013()
        {
            MonthPeriod testPeriod12 = new MonthPeriod(2013, 12);

            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod12);

            Assert.AreEqual(8500, engine.PeriodMandatoryBasis(testPeriod12));
        }
Exemplo n.º 7
0
        public void Should_return_HealthEngine2011_for_ClassNameEngine_when_Year_2011()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            MonthPeriod period2011 = new MonthPeriod(2011, 1);

            IHealthEngine engine2011 = engines.ResolveEngine(period2011);

            Assert.AreEqual(FULL_CLASS_NAME_2011, engine2011.GetType().ToString());
        }
        public EngineProfile(MonthPeriod payrunPeriod, IPeriodEngine period, ITaxingEngine taxing, IHealthEngine health, ISocialEngine social)
        {
            __payrunPeriod = payrunPeriod;

            __periodEngine = period;

            __taxingEngine = taxing;

            __healthEngine = health;

            __socialEngine = social;
        }
        public void Should_return_9200_for_Mandatory_Basis_when_General_Basis_is_0()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            bool testMandatoryDuty = true;

            decimal testIncome = 0m;

            decimal resultValue = engine.BasisMandatoryBalance(testPeriod,
                                                               testMandatoryDuty, testIncome);

            Assert.AreEqual(9200m, resultValue);
        }
Exemplo n.º 10
0
        public void Should_return_10_000_for_Cap_when_Basis_is_10_100_and_Accumulated_Basis_is_1_809_764()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            decimal testAktualMonthBasis = 10100m;

            decimal testAccumulatedBasis = 1809764m;

            decimal resultValue = engine.BasisLegalCapBalance(testPeriod,
                                                              testAccumulatedBasis, testAktualMonthBasis);

            Assert.AreEqual(10000m, resultValue);
        }
        public void Should_return_271_for_Payment_when_Basis_is_6_003_CZK()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            decimal testGeneralBasis = 6003m;

            bool testNegativeSuppress = true;

            decimal resultValue = engine.EmployeeGeneralContribution(testPeriod,
                                                                     testNegativeSuppress, testGeneralBasis);

            Assert.AreEqual(271m, resultValue);
        }
Exemplo n.º 12
0
        public void Should_return_Zero_for_Selector_when_Income_is_1000_and_Participation_is_False()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            bool testInsParticip = false;

            decimal testIncome = 1000m;

            decimal resultValue = engine.ParticipHealthSelector(testPeriod,
                                                                testInsParticip, testIncome);

            Assert.AreEqual(0, resultValue);
        }
        public void Should_return_Zero_for_Basis_when_Income_is_Negative_1000_01_and_Negative_Payments_is_False()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            bool testNegativeSuppress = true;

            decimal testIncome = -1000.01m;

            decimal resultValue = engine.BasisGeneralAdapted(testPeriod,
                                                             testNegativeSuppress, testIncome);

            Assert.AreEqual(0, resultValue);
        }
        public void Should_return_ZERO_for_Mandatory_Basis_when_General_Basis_is_1001_and_Mandatory_Duty_is_False()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            bool testMandatoryDuty = false;

            decimal testIncome = 1001m;

            decimal resultValue = engine.BasisMandatoryBalance(testPeriod,
                                                               testMandatoryDuty, testIncome);

            Assert.AreEqual(0, resultValue);
        }
        public void Should_return_Zero_for_Selector_when_Income_is_1000_and_Select_Article_is_False()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            bool testInsSubject = true;

            bool testInsArticle = false;

            decimal testIncome = 1000m;

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

            Assert.AreEqual(0, resultValue);
        }
        public void Should_return_900_for_Payment_when_Basis_is_10_000_CZK()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            decimal testGeneralBasis = 10000m;

            decimal testMandatoryEmpee = 0m;

            bool testNegativeSuppress = true;

            decimal resultValue = engine.EmployerGeneralContribution(testPeriod,
                                                                     testNegativeSuppress, testGeneralBasis, testMandatoryEmpee);

            Assert.AreEqual(900m, resultValue);
        }
        public void Should_return_270_for_Mandatory_Payment_when_Basis_is_6_003_CZK_and_Mandatory_Basis_is_2_001_CZK()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            decimal testGeneralBasis = 6003m;

            decimal testMandatoryEmpee = 0m;

            decimal testMandatoryBasis = 2001m;

            bool testNegativeSuppress = true;

            decimal resultValue = engine.EmployerMandatoryContribution(testPeriod,
                                                                       testNegativeSuppress, testGeneralBasis, testMandatoryEmpee, testMandatoryBasis);

            Assert.AreEqual(270m, resultValue);
        }
        public void Should_return_TRUE_for_Participation_when_WorkTerm_is_AgreementWorks_and_Income_is_2_500_CZK()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfWork = WorkRelationTerms.WORKTERM_EMPLOYMENT_1;

            WorkHealthTerms termOfHealth = WorkHealthTerms.HEALTH_TERM_AGREE_WORK;

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

            bool resultValue = engine.ParticipateHealthIncome(testPeriod,
                                                              termOfWork, termOfHealth, testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(true, resultValue);
        }
        public void Should_return_FALSE_for_Participation_when_WorkTerm_is_AgreementTasks_and_Income_is_9_999_CZK()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfWork = WorkRelationTerms.WORKTERM_CONTRACTER_T;

            WorkHealthTerms termOfHealth = WorkHealthTerms.HEALTH_TERM_AGREE_TASK;

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

            bool resultValue = engine.ParticipateHealthIncome(testPeriod,
                                                              termOfWork, termOfHealth, testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(false, resultValue);
        }