public void AddCarryOver(string fundingLineCode, ProfilingCarryOverType type, decimal amount) { Guard.IsNullOrWhiteSpace(fundingLineCode, nameof(fundingLineCode), "Funding Line Id cannot be missing"); Guard.Ensure(type != ProfilingCarryOverType.Undefined, $"Unsupported {nameof(ProfilingCarryOverType)}"); Guard.Ensure(amount > 0, "Carry overs must be greater than zero"); CarryOvers ??= new List <ProfilingCarryOver>(); CarryOvers.Add(new ProfilingCarryOver { FundingLineCode = fundingLineCode, Type = type, Amount = amount }); }
public void AddCarryOversAddsToInternalCollection() { string fundingLineId = NewRandomString(); decimal overPayment = NewRandomNumber(); ProfilingCarryOverType type = NewRandomCarryOverType(); WhenTheFundingLineCarryOverIsAdded(fundingLineId, overPayment, type); _publishedProviderVersion.CarryOvers .Should() .BeEquivalentTo(new ProfilingCarryOver { Type = type, Amount = overPayment, FundingLineCode = fundingLineId }); }
private void WhenTheFundingLineCarryOverIsAdded(string fundingLineId, decimal overPayment, ProfilingCarryOverType type) { _publishedProviderVersion.AddCarryOver(fundingLineId, type, overPayment); }
public ProfileCarryOverBuilder WithType(ProfilingCarryOverType type) { _type = type; return(this); }