public void PercentageChangedAggregation() { IEnumerable <AggregateFundingLine> fundingLines = WhenTheSchema1_1FundingLinesAreAggregated(); //check the percentage difference calc results IEnumerable <AggregateFundingCalculation> aggregateFundingCalculations = fundingLines.Single().Calculations; AggregateFundingCalculation sum = aggregateFundingCalculations.SingleOrDefault(_ => _.TemplateCalculationId == 9001); sum.Value .Should() .Be(-4.7833722155895512153611024900M); AggregateFundingCalculation average = aggregateFundingCalculations.SingleOrDefault(_ => _.TemplateCalculationId == 9002); average.Value .Should() .Be(5.0236732038232500M); AggregateFundingCalculation grouprate = aggregateFundingCalculations.SingleOrDefault(_ => _.TemplateCalculationId == 9005); grouprate.Value .Should() .Be(5.0236732038232500M); }
public void GroupRateAggregation() { IEnumerable <AggregateFundingLine> fundingLines = WhenTheSchema1_1FundingLinesAreAggregated(); //check the group rate calc results IEnumerable <AggregateFundingCalculation> aggregateFundingCalculations = fundingLines.Single().Calculations; AggregateFundingCalculation groupRate = aggregateFundingCalculations.SingleOrDefault(_ => _.TemplateCalculationId == 9003); groupRate .Value .Should() .Be(4701.66478M); AggregateFundingCalculation groupRateDivideByZero = aggregateFundingCalculations.SingleOrDefault(_ => _.TemplateCalculationId == 9004); groupRateDivideByZero .Value .Should() .Be(0M); }