public CalculatePremiumResult Calculate(UserPremiumData _userPremiumData)
        {
            // Get premium charges percentage by year
            double chargesPercentage = insuranceChargesPercentageList.FirstOrDefault(x => x.Key == _userPremiumData.year).Value;

            return(PremiumCalculation.Calculate(_userPremiumData.value, chargesPercentage, 18));
        }
Exemple #2
0
        /// <summary>
        /// Calculate premium
        /// </summary>
        /// <param name="_userPremiumData"></param>
        /// <returns></returns>
        static CalculatePremiumResult Calculate(UserPremiumData _userPremiumData)
        {
            // Create policy type manager according to policy type
            IPolicyTypeManager policyTypeManager = new PolicyTypeFactory().GetPolicyTypeManager(_userPremiumData.policyType);

            // Calculate result
            return(policyTypeManager.Calculate(_userPremiumData));
        }