示例#1
0
        public void ConditionMet_False_STDCode()
        {
            var progType             = 25;
            var aimType              = 1;
            var stdCode              = 0;
            var dd18Date             = new DateTime(2018, 01, 01);
            var learningDeliveryFams = It.IsAny <IEnumerable <ILearningDeliveryFAM> >();

            var larsStandard = new LARSStandard();

            var larsDataServiceMock = new Mock <ILARSDataService>();

            larsDataServiceMock.Setup(ldsm => ldsm.GetStandardFor(stdCode)).Returns(larsStandard);

            var learningDeliveryFamQueryServiceMock = new Mock <ILearningDeliveryFAMQueryService>();

            learningDeliveryFamQueryServiceMock
            .Setup(qs => qs.HasLearningDeliveryFAMType(learningDeliveryFams, "RES"))
            .Returns(false);

            NewRule(larsDataServiceMock.Object, learningDeliveryFamQueryServiceMock.Object)
            .ConditionMet(progType, aimType, stdCode, dd18Date, learningDeliveryFams)
            .Should()
            .BeFalse();
        }
示例#2
0
        public void LARSConditionMet_False_NoMatchingStandard()
        {
            int stdCode  = 1;
            var dd18Date = new DateTime(2018, 10, 01);

            var larsStandard = new LARSStandard();

            var larsDataServiceMock = new Mock <ILARSDataService>();

            larsDataServiceMock.Setup(ldsm => ldsm.GetStandardFor(1)).Returns(larsStandard);

            NewRule(larsDataServiceMock.Object).LARSConditionMet(stdCode, dd18Date).Should().BeFalse();
        }
示例#3
0
        public void Validate_NoError()
        {
            var stdCode  = 1;
            var dd18Date = new DateTime(2018, 01, 01);
            var learner  = new TestLearner()
            {
                LearningDeliveries = new List <TestLearningDelivery>()
                {
                    new TestLearningDelivery()
                    {
                        ProgTypeNullable     = 25,
                        AimType              = 3,
                        StdCodeNullable      = stdCode,
                        LearningDeliveryFAMs = new List <TestLearningDeliveryFAM>()
                        {
                            new TestLearningDeliveryFAM()
                            {
                                LearnDelFAMType = "RES"
                            }
                        }
                    }
                }
            };

            var learningDeliveryFams = learner.LearningDeliveries.SelectMany(ld => ld.LearningDeliveryFAMs);

            var larsStandard = new LARSStandard()
            {
                StandardCode = stdCode,
                EffectiveTo  = new DateTime(2018, 08, 01)
            };

            var dd18Mock = new Mock <IDerivedData_18Rule>();

            dd18Mock.Setup(dm => dm.GetApprenticeshipStandardProgrammeStartDateFor(It.IsAny <ILearningDelivery>(), It.IsAny <IReadOnlyCollection <ILearningDelivery> >())).Returns(dd18Date);

            var larsDataServiceMock = new Mock <ILARSDataService>();

            larsDataServiceMock.Setup(ldsm => ldsm.GetStandardFor(stdCode)).Returns(larsStandard);

            var learningDeliveryFamQueryServiceMock = new Mock <ILearningDeliveryFAMQueryService>();

            learningDeliveryFamQueryServiceMock
            .Setup(qs => qs.HasLearningDeliveryFAMType(learningDeliveryFams, "RES"))
            .Returns(true);

            using (var validationErrorHandlerMock = BuildValidationErrorHandlerMockForNoError())
            {
                NewRule(larsDataServiceMock.Object, learningDeliveryFamQueryServiceMock.Object, dd18Mock.Object, validationErrorHandlerMock.Object).Validate(learner);
            }
        }
        public void LARSStandardForStandardCode()
        {
            var stdCode      = 1;
            var larsStandard = new LARSStandard();

            var referenceDataCacheMock = new Mock <IExternalDataCache>();

            referenceDataCacheMock.SetupGet(rdc => rdc.LARSStandards)
            .Returns(
                new Dictionary <int, LARSStandard>()
            {
                { stdCode, larsStandard }
            });

            NewService(referenceDataCacheMock.Object).LARSStandardForStandardCode(stdCode).Should().Be(larsStandard);
        }
示例#5
0
        public void LARSConditionMet_True()
        {
            int stdCode  = 1;
            var dd18Date = new DateTime(2018, 10, 01);

            var larsStandard = new LARSStandard()
            {
                StandardCode = stdCode,
                EffectiveTo  = new DateTime(2018, 08, 01)
            };

            var larsDataServiceMock = new Mock <ILARSDataService>();

            larsDataServiceMock.Setup(ldsm => ldsm.GetStandardFor(stdCode)).Returns(larsStandard);

            NewRule(larsDataServiceMock.Object).LARSConditionMet(stdCode, dd18Date).Should().BeTrue();
        }
        [InlineData(LearningDeliveryFAMTypeConstants.RES, "2020-08-02", true)]  // LearnStartDate > LATS.LastDateStarts and == RES
        public void Validate_NoError(string famType, string startDate, bool returns)
        {
            int stdCode = 1;

            var larsStandard = new LARSStandard()
            {
                StandardCode   = stdCode,
                LastDateStarts = new DateTime(2020, 08, 01)
            };

            var learner = new TestLearner()
            {
                LearningDeliveries = new List <TestLearningDelivery>()
                {
                    new TestLearningDelivery()
                    {
                        StdCodeNullable      = stdCode,
                        ProgTypeNullable     = 25,
                        AimType              = 3,
                        LearnStartDate       = DateTime.Parse(startDate),
                        LearningDeliveryFAMs = new List <TestLearningDeliveryFAM>()
                        {
                            new TestLearningDeliveryFAM()
                            {
                                LearnDelFAMType = famType
                            }
                        }
                    }
                }
            };

            var larsDataServiceMock = new Mock <ILARSDataService>();

            larsDataServiceMock.Setup(l => l.GetStandardFor(stdCode)).Returns(larsStandard);

            var learningDeliveryFAMQueryServiceMock = new Mock <ILearningDeliveryFAMQueryService>();

            learningDeliveryFAMQueryServiceMock
            .Setup(qs => qs.HasLearningDeliveryFAMType(It.IsAny <IEnumerable <ILearningDeliveryFAM> >(), "RES"))
            .Returns(returns);

            using (var validationErrorHandlerMock = BuildValidationErrorHandlerMockForNoError())
            {
                NewRule(larsDataServiceMock.Object, learningDeliveryFAMQueryServiceMock.Object, validationErrorHandlerMock.Object).Validate(learner);
            }
        }
示例#7
0
        public void LARSConditionMet_False_EndDateCorrect()
        {
            int stdCode        = 1;
            var learnStartDate = new DateTime(2018, 8, 01);

            var larsStandard = new LARSStandard()
            {
                StandardCode = stdCode,
                EffectiveTo  = new DateTime(2018, 09, 01)
            };

            var larsDataServiceMock = new Mock <ILARSDataService>();

            larsDataServiceMock.Setup(ldsm => ldsm.GetStandardFor(stdCode)).Returns(larsStandard);

            NewRule(larsDataServiceMock.Object).LARSConditionMet(stdCode, learnStartDate).Should().BeFalse();
        }
示例#8
0
        public void Validate_Error()
        {
            var stdCode        = 1;
            var learnStartDate = new DateTime(2018, 10, 01);
            var learner        = new TestLearner()
            {
                LearningDeliveries = new List <TestLearningDelivery>()
                {
                    new TestLearningDelivery()
                    {
                        ProgTypeNullable     = 25,
                        AimType              = 1,
                        LearnStartDate       = learnStartDate,
                        StdCodeNullable      = stdCode,
                        LearningDeliveryFAMs = new List <TestLearningDeliveryFAM>()
                        {
                            new TestLearningDeliveryFAM()
                        }
                    }
                }
            };

            var learningDeliveryFams = learner.LearningDeliveries.SelectMany(ld => ld.LearningDeliveryFAMs);

            var larsStandard = new LARSStandard()
            {
                StandardCode = stdCode,
                EffectiveTo  = new DateTime(2018, 08, 01)
            };

            var larsDataServiceMock = new Mock <ILARSDataService>();

            larsDataServiceMock.Setup(ldsm => ldsm.GetStandardFor(stdCode)).Returns(larsStandard);

            var learningDeliveryFamQueryServiceMock = new Mock <ILearningDeliveryFAMQueryService>();

            learningDeliveryFamQueryServiceMock
            .Setup(qs => qs.HasLearningDeliveryFAMType(learningDeliveryFams, "RES"))
            .Returns(false);

            using (var validationErrorHandlerMock = BuildValidationErrorHandlerMockForError())
            {
                NewRule(larsDataServiceMock.Object, learningDeliveryFamQueryServiceMock.Object, validationErrorHandlerMock.Object).Validate(learner);
            }
        }
示例#9
0
        public void MapTo()
        {
            var ukprn          = 1;
            var learnAimRef    = "LearnAimRef";
            var delLocPostCode = "Postcode";
            var stdCode        = 1;

            var larsVersion      = "1.0.0";
            var year             = "2021";
            var collectionPeriod = "DefaultPeriod";

            var global = new Global
            {
                LARSVersion      = larsVersion,
                UKPRN            = ukprn,
                Year             = year,
                CollectionPeriod = collectionPeriod
            };

            var learnerDtos = new List <FM36LearnerDto>
            {
                new FM36LearnerDto
                {
                    ULN = 1,
                    LearningDeliveries = new List <LearningDelivery>
                    {
                        new LearningDelivery
                        {
                            LearnAimRef    = learnAimRef,
                            DelLocPostCode = delLocPostCode,
                            FundModel      = 36,
                            StdCode        = stdCode
                        }
                    }
                },
                new FM36LearnerDto
                {
                    ULN = 1,
                    LearningDeliveries = new List <LearningDelivery>
                    {
                        new LearningDelivery
                        {
                            LearnAimRef    = learnAimRef,
                            DelLocPostCode = delLocPostCode,
                            FundModel      = 36,
                            StdCode        = stdCode
                        }
                    }
                },
            };

            var larsLearningDelivery = new LARSLearningDelivery
            {
                AwardOrgCode         = "awardOrgCode",
                EFACOFType           = 1,
                LearnAimRefTitle     = "learnAimRefTitle",
                LearnAimRefType      = "learnAimRefType",
                RegulatedCreditValue = 2,
                NotionalNVQLevelv2   = "NVQLevel",
                LARSFundings         = new List <LARSFunding>
                {
                    new LARSFunding
                    {
                        FundingCategory = "Matrix",
                        RateWeighted    = 1.0m,
                        WeightingFactor = "G",
                        EffectiveFrom   = new DateTime(2019, 1, 1),
                        EffectiveTo     = new DateTime(2020, 1, 1),
                    }
                }
            };

            var larsStandard = new LARSStandard
            {
                StandardCode = 1,
            };

            IEnumerable <DasDisadvantage> dasDisadvantage = new List <DasDisadvantage>
            {
                new DasDisadvantage
                {
                    Postcode      = "DelLocPostcode",
                    EffectiveFrom = new DateTime(2019, 1, 1),
                    EffectiveTo   = new DateTime(2020, 1, 1),
                    Uplift        = 1.2m
                }
            };

            var postcodesRefererenceDataServiceMock   = new Mock <IPostcodesReferenceDataService>();
            var appsHistoryRefererenceDataServiceMock = new Mock <IAppsEarningsHistoryReferenceDataService>();
            var larsReferenceDataServiceMock          = new Mock <ILARSReferenceDataService>();

            larsReferenceDataServiceMock.Setup(l => l.LARSCurrentVersion()).Returns(global.LARSVersion);
            larsReferenceDataServiceMock.Setup(l => l.LARSLearningDeliveryForLearnAimRef(learnAimRef)).Returns(larsLearningDelivery);
            larsReferenceDataServiceMock.Setup(l => l.LARSStandardForStandardCode(stdCode)).Returns(larsStandard);

            postcodesRefererenceDataServiceMock.Setup(l => l.DASDisadvantagesForPostcode(It.IsAny <string>())).Returns(dasDisadvantage);
            appsHistoryRefererenceDataServiceMock.Setup(l => l.AECEarningsHistory(It.IsAny <long>())).Returns(new List <AECEarningsHistory>());

            var dataEntities = NewService(
                larsReferenceDataServiceMock.Object,
                postcodesRefererenceDataServiceMock.Object,
                appsHistoryRefererenceDataServiceMock.Object)
                               .MapTo(ukprn, learnerDtos);

            dataEntities.Should().HaveCount(2);
            dataEntities.SelectMany(d => d.Children).Should().NotBeNullOrEmpty();
        }
        public void MapTo()
        {
            var ukprn       = 1;
            var learnAimRef = "LearnAImRef";
            var stdCode     = 1;

            var global = new Global
            {
                LARSVersion = "1.0.0",
                UKPRN       = 1234
            };

            var learnerDtos = new List <FM81LearnerDto>
            {
                new FM81LearnerDto
                {
                    LearningDeliveries = new List <LearningDelivery>
                    {
                        new LearningDelivery
                        {
                            LearnAimRef = learnAimRef,
                            FundModel   = 81,
                            ProgType    = 25,
                            StdCode     = stdCode
                        }
                    }
                },
                new FM81LearnerDto
                {
                    LearningDeliveries = new List <LearningDelivery>
                    {
                        new LearningDelivery
                        {
                            LearnAimRef = learnAimRef,
                            FundModel   = 81,
                            ProgType    = 25,
                            StdCode     = stdCode
                        }
                    }
                },
            };

            var larsLearningDelivery = new LARSLearningDelivery
            {
                AwardOrgCode         = "awardOrgCode",
                EFACOFType           = 1,
                LearnAimRefTitle     = "learnAimRefTitle",
                LearnAimRefType      = "learnAimRefType",
                RegulatedCreditValue = 2,
                NotionalNVQLevelv2   = "NVQLevel",
                LARSFundings         = new List <LARSFunding>
                {
                    new LARSFunding
                    {
                        FundingCategory = "Matrix",
                        RateWeighted    = 1.0m,
                        WeightingFactor = "G",
                        EffectiveFrom   = new DateTime(2020, 1, 1),
                        EffectiveTo     = new DateTime(2020, 1, 1),
                    }
                },
            };

            var larsStandard = new LARSStandard
            {
                StandardCode = 1,
            };

            var larsReferenceDataServiceMock = new Mock <ILARSReferenceDataService>();

            larsReferenceDataServiceMock.Setup(l => l.LARSCurrentVersion()).Returns(global.LARSVersion);

            larsReferenceDataServiceMock.Setup(l => l.LARSLearningDeliveryForLearnAimRef(learnAimRef)).Returns(larsLearningDelivery);
            larsReferenceDataServiceMock.Setup(l => l.LARSStandardForStandardCode(stdCode)).Returns(larsStandard);

            var dataEntities = NewService(larsReferenceDataServiceMock.Object).MapTo(ukprn, learnerDtos);

            dataEntities.Should().HaveCount(2);
            dataEntities.SelectMany(d => d.Children).Should().NotBeNullOrEmpty();
        }
示例#11
0
        public IDataEntity GetDataEntityMapperEntity()
        {
            var larsReferenceDataServiceMock                = new Mock <ILARSReferenceDataService>();
            var postcodesReferenceDataServiceMock           = new Mock <IPostcodesReferenceDataService>();
            var appsEarningsHistoryReferenceDataServiceMock = new Mock <IAppsEarningsHistoryReferenceDataService>();

            var learner = new FM36LearnerDto
            {
                LearnRefNumber            = "Learner1",
                PostcodePrior             = "Postcode",
                ULN                       = 1234567890,
                LearnerEmploymentStatuses = new List <LearnerEmploymentStatus>
                {
                    new LearnerEmploymentStatus
                    {
                        EmpId          = 10,
                        DateEmpStatApp = new DateTime(2018, 8, 1),
                        EmpStat        = 2,
                        SEM            = 1
                    },
                },
                LearningDeliveries = new List <LearningDelivery>
                {
                    new LearningDelivery
                    {
                        LearnAimRef          = "1",
                        AimSeqNumber         = 2,
                        AimType              = 3,
                        CompStatus           = 4,
                        PwayCode             = 5,
                        ProgType             = 6,
                        FworkCode            = 7,
                        FundModel            = 36,
                        StdCode              = 8,
                        LearnStartDate       = new DateTime(2018, 8, 1),
                        LearnPlanEndDate     = new DateTime(2019, 8, 1),
                        DelLocPostCode       = "Postcode",
                        LearningDeliveryFAMs = new List <LearningDeliveryFAM>
                        {
                            new LearningDeliveryFAM()
                        },
                        AppFinRecords = new List <AppFinRecord>
                        {
                            new AppFinRecord()
                        }
                    },
                },
            };

            var frameworks = new List <LARSFramework>
            {
                new LARSFramework
                {
                    EffectiveFromNullable = new DateTime(2018, 1, 1),
                    EffectiveTo           = new DateTime(2019, 1, 1),
                    FworkCode             = 7,
                    ProgType         = 6,
                    PwayCode         = 5,
                    LARSFrameworkAim = new LARSFrameworkAim
                    {
                        EffectiveFrom          = new DateTime(2018, 1, 1),
                        EffectiveTo            = new DateTime(2019, 1, 1),
                        FrameworkComponentType = 1,
                    },
                    LARSFrameworkApprenticeshipFundings = new List <LARSFrameworkApprenticeshipFunding>
                    {
                        new LARSFrameworkApprenticeshipFunding()
                    },
                    LARSFrameworkCommonComponents = new List <LARSFrameworkCommonComponent>
                    {
                        new LARSFrameworkCommonComponent()
                    }
                },
                new LARSFramework
                {
                    EffectiveFromNullable = new DateTime(2018, 1, 1),
                    EffectiveTo           = new DateTime(2019, 1, 1),
                    FworkCode             = 9,
                    ProgType         = 9,
                    PwayCode         = 5,
                    LARSFrameworkAim = new LARSFrameworkAim
                    {
                        EffectiveFrom          = new DateTime(2018, 1, 1),
                        EffectiveTo            = new DateTime(2019, 1, 1),
                        FrameworkComponentType = 1,
                    }
                }
            };

            var larsLearningDelivery = new LARSLearningDelivery
            {
                LARSFundings = new List <LARSFunding>
                {
                    new LARSFunding()
                },
                LARSFrameworks = frameworks
            };

            var larsStandards = new LARSStandard
            {
                LARSStandardApprenticeshipFundings = new List <LARSStandardApprenticeshipFunding>
                {
                    new LARSStandardApprenticeshipFunding()
                },
                LARSStandardCommonComponents = new List <LARSStandardCommonComponent>
                {
                    new LARSStandardCommonComponent()
                }
            };

            var learningDelivery = learner.LearningDeliveries.First();

            larsReferenceDataServiceMock.Setup(l => l.LARSLearningDeliveryForLearnAimRef(learningDelivery.LearnAimRef)).Returns(larsLearningDelivery);
            larsReferenceDataServiceMock.Setup(l => l.LARSStandardForStandardCode(learningDelivery.StdCode)).Returns(larsStandards);
            postcodesReferenceDataServiceMock.Setup(p => p.DASDisadvantagesForPostcode(learner.PostcodePrior)).Returns(new List <DasDisadvantage> {
                new DasDisadvantage()
            });
            appsEarningsHistoryReferenceDataServiceMock.Setup(a => a.AECEarningsHistory(learner.ULN)).Returns(new List <AECEarningsHistory> {
                new AECEarningsHistory()
            });

            return(new DataEntityMapper(
                       larsReferenceDataServiceMock.Object,
                       postcodesReferenceDataServiceMock.Object,
                       appsEarningsHistoryReferenceDataServiceMock.Object).BuildGlobalDataEntity(learner, new Global()));
        }
示例#12
0
        public void MapTo()
        {
            var ukprn           = 1;
            var larsVersion     = "1.0.0";
            var orgVersion      = "1.0.0";
            var postcodeVersion = "1.0.0";
            var learnAimRef     = "LearnAimRef";
            var postcodePrior   = "Postcode";
            var delLocPostcode  = "Postcode";
            var empId           = 1;

            var global = new Global
            {
                LARSVersion = larsVersion,
                UKPRN       = ukprn,
                OrgVersion  = orgVersion,
                PostcodeDisadvantageVersion = postcodeVersion
            };

            var learnerDtos = new List <FM35LearnerDto>
            {
                new FM35LearnerDto
                {
                    PostcodePrior             = postcodePrior,
                    LearnerEmploymentStatuses = new List <LearnerEmploymentStatus>
                    {
                        new LearnerEmploymentStatus
                        {
                            EmpId = empId
                        }
                    },
                    LearningDeliveries = new List <LearningDelivery>
                    {
                        new LearningDelivery
                        {
                            LearnAimRef    = learnAimRef,
                            FundModel      = 35,
                            DelLocPostCode = delLocPostcode
                        }
                    }
                },
                new FM35LearnerDto
                {
                    PostcodePrior             = postcodePrior,
                    LearnerEmploymentStatuses = new List <LearnerEmploymentStatus>
                    {
                        new LearnerEmploymentStatus
                        {
                            EmpId = empId
                        }
                    },
                    LearningDeliveries = new List <LearningDelivery>
                    {
                        new LearningDelivery
                        {
                            LearnAimRef = learnAimRef,
                            FundModel   = 35,
                        }
                    }
                },
            };

            var larsLearningDelivery = new LARSLearningDelivery
            {
                AwardOrgCode         = "awardOrgCode",
                EFACOFType           = 1,
                LearnAimRefTitle     = "learnAimRefTitle",
                LearnAimRefType      = "learnAimRefType",
                RegulatedCreditValue = 2,
                NotionalNVQLevelv2   = "NVQLevel",
                LARSFundings         = new List <LARSFunding>
                {
                    new LARSFunding
                    {
                        FundingCategory = "Matrix",
                        RateWeighted    = 1.0m,
                        WeightingFactor = "G",
                        EffectiveFrom   = new DateTime(2019, 1, 1),
                        EffectiveTo     = new DateTime(2020, 1, 1),
                    }
                }
            };

            var larsStandard = new LARSStandard
            {
                StandardCode = 1,
            };

            IEnumerable <DasDisadvantage> dasDisadvantage = new List <DasDisadvantage>
            {
                new DasDisadvantage
                {
                    Postcode      = "DelLocPostcode",
                    EffectiveFrom = new DateTime(2019, 1, 1),
                    EffectiveTo   = new DateTime(2020, 1, 1),
                    Uplift        = 1.2m
                }
            };

            var largeEmployersReferenceDataServiceMock = new Mock <ILargeEmployersReferenceDataService>();
            var larsReferenceDataServiceMock           = new Mock <ILARSReferenceDataService>();
            var orgReferenceDataServiceMock            = new Mock <IOrganisationReferenceDataService>();
            var postcodesReferenceDataServiceMock      = new Mock <IPostcodesReferenceDataService>();

            largeEmployersReferenceDataServiceMock.Setup(l => l.LargeEmployersforEmpID(empId)).Returns(new List <LargeEmployers> {
                new LargeEmployers()
            });
            larsReferenceDataServiceMock.Setup(l => l.LARSCurrentVersion()).Returns(global.LARSVersion);
            larsReferenceDataServiceMock.Setup(l => l.LARSLearningDeliveryForLearnAimRef(learnAimRef)).Returns(larsLearningDelivery);
            orgReferenceDataServiceMock.Setup(o => o.OrganisationFundingForUKPRN(global.UKPRN)).Returns(new List <OrgFunding> {
                new OrgFunding()
            });
            postcodesReferenceDataServiceMock.Setup(o => o.SFADisadvantagesForPostcode(postcodePrior)).Returns(new List <SfaDisadvantage>());

            var dataEntities = NewService(
                largeEmployersReferenceDataServiceMock.Object,
                larsReferenceDataServiceMock.Object,
                orgReferenceDataServiceMock.Object,
                postcodesReferenceDataServiceMock.Object)
                               .MapTo(ukprn, learnerDtos);

            dataEntities.Should().HaveCount(2);
            dataEntities.SelectMany(d => d.Children).Should().NotBeNullOrEmpty();
        }
示例#13
0
        public void Build_SingleRow()
        {
            var reportServiceContext = Mock.Of <IReportServiceContext>();
            var dependentDataMock    = new Mock <IReportServiceDependentData>();

            var actLearningDeliveryFam = new Mock <ILearningDeliveryFAM>();

            actLearningDeliveryFam.SetupGet(fam => fam.LearnDelFAMType).Returns("ACT");
            actLearningDeliveryFam.SetupGet(fam => fam.LearnDelFAMCode).Returns("1");

            var albLearningDeliveryFam = new Mock <ILearningDeliveryFAM>();

            albLearningDeliveryFam.SetupGet(fam => fam.LearnDelFAMType).Returns("ALB");

            var learningDeliveryFams = new List <ILearningDeliveryFAM>()
            {
                actLearningDeliveryFam.Object,
                albLearningDeliveryFam.Object,
            };

            var providerSpecDeliveryMonitorings = new List <IProviderSpecDeliveryMonitoring>()
            {
                new TestProviderSpecDeliveryMonitoring(),
            };

            var learningDelivery = new TestLearningDelivery()
            {
                FundModel                       = 36,
                LearnAimRef                     = "learnAimRef",
                AimSeqNumber                    = 1,
                LearningDeliveryFAMs            = learningDeliveryFams,
                ProviderSpecDeliveryMonitorings = providerSpecDeliveryMonitorings,
                StdCodeNullable                 = 1
            };

            var providerSpecLearnerMonitorings = new List <IProviderSpecLearnerMonitoring>()
            {
                new TestProviderSpecLearnerMonitoring(),
            };

            var learner = new TestLearner()
            {
                LearnRefNumber     = "LearnRefNumber",
                LearningDeliveries = new List <ILearningDelivery>()
                {
                    learningDelivery
                },
                ProviderSpecLearnerMonitorings = providerSpecLearnerMonitorings,
            };

            var message = new TestMessage()
            {
                Learners = new List <ILearner>()
                {
                    learner
                }
            };

            var larsLearningDelivery = new LARSLearningDelivery()
            {
                LearnAimRef            = "learnAimRef",
                LearnAimRefTitle       = "A",
                NotionalNVQLevel       = "B",
                SectorSubjectAreaTier2 = 3
            };

            var larsStandard = new LARSStandard()
            {
                StandardCode     = 1,
                NotionalEndLevel = "NotionalEndLevel"
            };

            var referenceDataRoot = new ReferenceDataRoot()
            {
                LARSLearningDeliveries = new List <LARSLearningDelivery>()
                {
                    larsLearningDelivery
                },
                LARSStandards = new List <LARSStandard>()
                {
                    larsStandard
                }
            };

            var priceEpisodeValues = new PriceEpisodeValues()
            {
                EpisodeStartDate         = new DateTime(2020, 08, 08),
                PriceEpisodeAimSeqNumber = 1
            };

            var priceEpisodes = new PriceEpisode()
            {
                PriceEpisodeValues           = priceEpisodeValues,
                PriceEpisodePeriodisedValues = new List <PriceEpisodePeriodisedValues>()
                {
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeOnProgPaymentAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm3PriceEpisodeBalancePaymentAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeCompletionPaymentAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeLSFCashAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeFirstDisadvantagePaymentAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeSecondDisadvantagePaymentAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeFirstEmp1618PayAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeSecondEmp1618PayAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeFirstProv1618PayAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeSecondProv1618PayAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeLearnerAdditionalPaymentAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeApplic1618FrameworkUpliftOnProgPaymentAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeApplic1618FrameworkUpliftBalancingAttributeName),
                    BuildPriceEpisodePeriodisedValuesForAttribute(AttributeConstants.Fm36PriceEpisodeApplic1618FrameworkUpliftCompletionPaymentAttributeName),
                }
            };

            var learningDeliveryValues = new LearningDeliveryValues();
            var appsLearningDelivery   = new LearningDelivery()
            {
                AimSeqNumber                     = 1,
                LearningDeliveryValues           = learningDeliveryValues,
                LearningDeliveryPeriodisedValues = new List <LearningDeliveryPeriodisedValues>()
                {
                    BuildLearningDeliveryPeriodisedValuesForAttribute(AttributeConstants.Fm36MathEngOnProgPayment),
                    BuildLearningDeliveryPeriodisedValuesForAttribute(AttributeConstants.Fm36MathEngBalPayment),
                    BuildLearningDeliveryPeriodisedValuesForAttribute(AttributeConstants.Fm36LearnSuppFundCash)
                }
            };

            var fm36Global = new FM36Global()
            {
                Learners = new List <FM36Learner>()
                {
                    new FM36Learner()
                    {
                        LearnRefNumber     = "LearnRefNumber",
                        LearningDeliveries = new List <LearningDelivery>()
                        {
                            appsLearningDelivery,
                        },
                        PriceEpisodes = new List <PriceEpisode>()
                        {
                            priceEpisodes
                        }
                    }
                }
            };

            dependentDataMock.Setup(d => d.Get <IMessage>()).Returns(message);
            dependentDataMock.Setup(d => d.Get <ReferenceDataRoot>()).Returns(referenceDataRoot);
            dependentDataMock.Setup(d => d.Get <FM36Global>()).Returns(fm36Global);

            var providerSpecDeliveryMonitoringModel = new ProviderSpecDeliveryMonitoringModel();
            var providerSpecLearnerMonitoringModel  = new ProviderSpecLearnerMonitoringModel();
            var learningDeliveryFamsModel           = new LearningDeliveryFAMsModel();

            var ilrModelMapperMock = new Mock <IIlrModelMapper>();

            ilrModelMapperMock.Setup(m => m.MapLearningDeliveryFAMs(learningDeliveryFams)).Returns(learningDeliveryFamsModel);
            ilrModelMapperMock.Setup(m => m.MapProviderSpecDeliveryMonitorings(providerSpecDeliveryMonitorings)).Returns(providerSpecDeliveryMonitoringModel);
            ilrModelMapperMock.Setup(m => m.MapProviderSpecLearnerMonitorings(providerSpecLearnerMonitorings)).Returns(providerSpecLearnerMonitoringModel);

            var result = NewBuilder(ilrModelMapperMock.Object).Build(reportServiceContext, dependentDataMock.Object).ToList();

            result.Should().HaveCount(1);

            var row = result[0];

            row.Learner.Should().Be(learner);
            row.LearningDelivery.Should().Be(learningDelivery);
            row.LarsLearningDelivery.Should().Be(larsLearningDelivery);
            row.Fm36LearningDelivery.Should().Be(learningDeliveryValues);

            row.ProviderSpecDeliveryMonitoring.Should().Be(providerSpecDeliveryMonitoringModel);
            row.ProviderSpecLearnerMonitoring.Should().Be(providerSpecLearnerMonitoringModel);
            row.PeriodisedValues.Should().NotBeNull();
            row.LearningDeliveryFAMs.Should().Be(learningDeliveryFamsModel);


            row.PeriodisedValues.August.AdditionalPaymentsForApprentices.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.AimCompletionEarnings.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.BalancingPaymentEarnings.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.EnglishMathsBalancingPaymentEarnings.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.EnglishMathsOnProgrammeEarnings.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.FrameworkUpliftBalancingPayment1618.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.FrameworkUpliftCompletionPayment1618.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.FrameworkUpliftOnProgrammePayment1618.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.LearningSupportEarnings.Should().Be((decimal)1.111);
            row.PeriodisedValues.August.OnProgrammeEarnings.Should().Be((decimal)1.111);

            row.PeriodisedValues.August.DisadvantageEarnings.Should().Be((decimal)2.222);
            row.PeriodisedValues.May.DisadvantageEarnings.Should().Be((decimal)20.2020);

            row.PeriodisedValues.August.AdditionalPaymentForEmployers1618.Should().Be((decimal)2.222);
            row.PeriodisedValues.May.AdditionalPaymentForEmployers1618.Should().Be((decimal)20.2020);

            row.PeriodisedValues.August.AdditionalPaymentForProviders1618.Should().Be((decimal)2.222);
            row.PeriodisedValues.May.AdditionalPaymentForProviders1618.Should().Be((decimal)20.2020);

            //var csvService = new CsvService(new FileServiceStub());
            //csvService.WriteAsync<AppsIndicativeEarningsReportModel, AppsIndicativeEarningsReportClassMap>(result, "AppsIndicativeEarningsReport.csv", "", CancellationToken.None).ConfigureAwait(false);
        }