예제 #1
0
        public decimal CalculateFinalQuote(ApplicantDetails quote)
        {
            decimal BasePremium = new BasePrice().ReturnBasePrice(quote);

            decimal AfterRHI = BasePremium + new CountryOfResidence().ReturnRHIDifference(quote.Country);

            ChildLoading child = new ChildLoading();
            decimal      PremiumAfterChildLoad = child.ApplyChildLoading(AfterRHI, quote.HasChildren);

            SmokerLoading smoke = new SmokerLoading();
            decimal       PremiumAfterSmoking = smoke.ApplySmokerLoading(PremiumAfterChildLoad, quote.IsSmoker);

            HealthyLifeStyleBonus HLB = new HealthyLifeStyleBonus();
            decimal PremiumAfterLifeStyleAdjustment = HLB.ApplyLifeStyleBonus(PremiumAfterSmoking, quote.WeeklyExcercise);

            return(PremiumAfterLifeStyleAdjustment);
        }
예제 #2
0
        public void NoChildren_ShouldNotLoadPremiun()
        {
            ChildLoading child = new ChildLoading();

            Assert.AreEqual(child.ApplyChildLoading(100, false), 100);
        }
예제 #3
0
        public void WithChildren_ShouldIncreasePremiumBy50Percent()
        {
            ChildLoading child = new ChildLoading();

            Assert.AreEqual(child.ApplyChildLoading(100, true), 150);
        }