Example #1
0
        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
            });
        }
Example #2
0
        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
            });
        }
Example #3
0
 private void WhenTheFundingLineCarryOverIsAdded(string fundingLineId, decimal overPayment, ProfilingCarryOverType type)
 {
     _publishedProviderVersion.AddCarryOver(fundingLineId, type, overPayment);
 }
Example #4
0
        public ProfileCarryOverBuilder WithType(ProfilingCarryOverType type)
        {
            _type = type;

            return(this);
        }