public void TestMapToLevyFundingSourcePaymentEvent() { var expectedEvent = new LevyFundingSourcePaymentEvent { AgreementId = "11" }; PopulateCommonProperties(expectedEvent); var actualEvent = new LevyFundingSourcePaymentEvent { AmountDue = 55, FundingSourceType = FundingSourceType.Levy }; // act autoMapper.Map(requiredPaymentEvent, actualEvent); // assert actualEvent.EventTime.Should().NotBe(expectedEvent.EventTime); actualEvent.EventId.Should().NotBe(expectedEvent.EventId); actualEvent.EventTime = expectedEvent.EventTime; actualEvent.EventId = expectedEvent.EventId; actualEvent.Should().BeEquivalentTo(expectedEvent); }
public void CanMapFromLevyFundingSourcePaymentEventToPayment() { var agreementId = "AGREEMENT"; var levy = new LevyFundingSourcePaymentEvent { EventId = Guid.NewGuid(), CollectionPeriod = new CollectionPeriod { Period = 12, AcademicYear = 1819 }, Learner = new Learner { ReferenceNumber = "1234-ref", Uln = 123456 }, TransactionType = TransactionType.Completion, Ukprn = 12345, ContractType = ContractType.Act1, SfaContributionPercentage = 0.9m, PriceEpisodeIdentifier = "pe-1", JobId = 123, AmountDue = 300, FundingSourceType = FundingSourceType.CoInvestedEmployer, DeliveryPeriod = 12, LearningAim = new LearningAim { PathwayCode = 12, FrameworkCode = 1245, FundingLineType = "Non-DAS 16-18 Learner", StandardCode = 1209, ProgrammeType = 7890, Reference = "1234567-aim-ref" }, IlrSubmissionDateTime = DateTime.UtcNow, EventTime = DateTimeOffset.UtcNow, AgreementId = agreementId, RequiredPaymentEventId = Guid.NewGuid(), ClawbackSourcePaymentEventId = Guid.NewGuid(), AccountId = 123456789, ApprenticeshipEmployerType = ApprenticeshipEmployerType.NonLevy, }; var payment = Mapper.Map <ProviderPaymentEventModel>(levy); payment.Ukprn.Should().Be(levy.Ukprn); payment.CollectionPeriod.Should().Be(levy.CollectionPeriod.Period); payment.AcademicYear.Should().Be(levy.CollectionPeriod.AcademicYear); payment.DeliveryPeriod.Should().Be(levy.DeliveryPeriod); payment.FundingSourceId.Should().Be(levy.EventId); payment.ContractType.Should().Be(levy.ContractType); payment.SfaContributionPercentage.Should().Be(levy.SfaContributionPercentage); payment.Amount.Should().Be(levy.AmountDue); payment.FundingSource.Should().Be(levy.FundingSourceType); payment.JobId.Should().Be(levy.JobId); payment.IlrSubmissionDateTime.Should().Be(levy.IlrSubmissionDateTime); payment.AccountId.Should().Be(levy.AccountId); payment.ApprenticeshipEmployerType.Should().Be(levy.ApprenticeshipEmployerType); payment.RequiredPaymentEventId.Should().Be(levy.RequiredPaymentEventId); payment.ClawbackSourcePaymentEventId.Should().Be(levy.ClawbackSourcePaymentEventId); }