public void CalculatePremiumForInitialAndAdditionalSetOfRisks() { var additionalinsurancePeriod = new InsurancePeriod(DateTime.Now.AddMonths(6), 6); var additionalRisk = new Risk { Name = fixture.Create <string>(), YearlyPrice = 50 }; var riskInsuredPeriod = new RiskInsurancePeriod(additionalinsurancePeriod, additionalRisk); var insurancePeriod = new InsurancePeriod(DateTime.Now, 12); var insuredRisks = new List <Risk> { new Risk { Name = fixture.Create <string>(), YearlyPrice = 40m }, new Risk { Name = fixture.Create <string>(), YearlyPrice = 36m } }; var initialRiskSet = new InitialRiskSet(insuredRisks, insurancePeriod, riskInsuredPeriod); var premium = initialRiskSet.CalculatePremium(); Assert.Equal(101m, premium); }
public void CalculatePremiumForInitialSetOfRisks() { var insurancePeriod = new InsurancePeriod(DateTime.Now, 12); var insuredRisks = new List <Risk> { new Risk { Name = fixture.Create <string>(), YearlyPrice = 40m }, new Risk { Name = fixture.Create <string>(), YearlyPrice = 36m } }; var initialRiskSet = new InitialRiskSet(insuredRisks, insurancePeriod); var premium = initialRiskSet.CalculatePremium(); Assert.Equal(76m, premium); }