private static void AssertCommonProperties(PeriodisedRequiredPaymentEvent requiredPayment, IEarningEvent earning)
 {
     Assert.AreEqual(requiredPayment.Learner.Uln, earning.Learner.Uln);
     Assert.AreEqual(requiredPayment.Learner.ReferenceNumber, earning.Learner.ReferenceNumber);
     Assert.AreEqual(requiredPayment.Ukprn, earning.Ukprn);
     Assert.AreEqual(requiredPayment.CollectionPeriod.Period, earning.CollectionPeriod.Period);
     Assert.AreEqual(requiredPayment.CollectionPeriod.AcademicYear, earning.CollectionPeriod.AcademicYear);
     Assert.AreEqual(requiredPayment.LearningAim.PathwayCode, earning.LearningAim.PathwayCode);
     Assert.AreEqual(requiredPayment.LearningAim.FrameworkCode, earning.LearningAim.FrameworkCode);
     Assert.AreEqual(requiredPayment.LearningAim.ProgrammeType, earning.LearningAim.ProgrammeType);
     Assert.AreEqual(requiredPayment.LearningAim.Reference, earning.LearningAim.Reference);
     Assert.AreEqual(requiredPayment.LearningAim.StandardCode, earning.LearningAim.StandardCode);
     Assert.AreEqual(requiredPayment.JobId, earning.JobId);
     Assert.AreEqual(requiredPayment.IlrSubmissionDateTime, earning.IlrSubmissionDateTime);
 }
        private static bool PriceEpisodeContractTypeMatchesAim(List <Price> priceEpisodes, string priceEpisodeIdentifier, IEarningEvent onProgEarning)
        {
            var matchingPriceEpisode = priceEpisodes.FirstOrDefault(p =>
                                                                    p.PriceEpisodeId == priceEpisodeIdentifier);

            switch (onProgEarning)
            {
            case ApprenticeshipContractType1EarningEvent _:
                return(matchingPriceEpisode?.ContractType == ContractType.Act1);

            case ApprenticeshipContractType2EarningEvent _:
                return(matchingPriceEpisode?.ContractType == ContractType.Act2);

            default:
                return(false);
            }
        }