public void ThenTheUpsertedProviderVersionForHasTheFollowingFundingLineOverPayments(string providerId, IEnumerable <ExpectedFundingLineOverPayment> expectedFundingLineOverPayments) { PublishedProviderVersion publishedProviderVersion = GetUpsertedPublishedProviderVersion(providerId); IEnumerable <ProfilingCarryOver> carryOvers = publishedProviderVersion.CarryOvers ?? new List <ProfilingCarryOver>(); foreach (ExpectedFundingLineOverPayment expectedFundingLineOverPayment in expectedFundingLineOverPayments) { string fundingLineCode = expectedFundingLineOverPayment.FundingLineCode; ProfilingCarryOver carryOver = carryOvers.FirstOrDefault(_ => _.FundingLineCode == fundingLineCode); carryOver .Should() .BeEquivalentTo(new ProfilingCarryOver { FundingLineCode = fundingLineCode, Type = ProfilingCarryOverType.DSGReProfiling, Amount = expectedFundingLineOverPayment.OverPayment }); } }
private void AndTheFundingLineOverPaymentShouldBe(decimal?expectedOverPayment) { IEnumerable <ProfilingCarryOver> overPayments = VariationContext.RefreshState.CarryOvers; if (expectedOverPayment == null) { overPayments .Should() .BeNull(); } else { ProfilingCarryOver carryOver = overPayments.FirstOrDefault(_ => _.FundingLineCode == _fundingLineCode); carryOver .Should() .BeEquivalentTo(new ProfilingCarryOver { Type = ProfilingCarryOverType.DSGReProfiling, Amount = expectedOverPayment.GetValueOrDefault(), FundingLineCode = _fundingLineCode }); } }