Exemplo n.º 1
0
        public async Task ResubmitTheEvent()
        {
            var identifiedRemovedLearningAimEvent = Context.Get <IdentifiedRemovedLearningAim>(IdentifiedRemovedLearningAim);

            identifiedRemovedLearningAimEvent.EventId = Guid.NewGuid();
            await MessageSession.Publish(identifiedRemovedLearningAimEvent);
        }
 public async Task WhenThereIsAChangeToTheApprenticeshipDetailsForOneOfTheProviderSLearners()
 {
     await MessageSession.Publish <ApprenticeshipUpdated>(m =>
     {
         m.Ukprn = TestSession.Ukprn;
     });
 }
 public async Task WhenNewSuccessfulAppearsInLatestSuccessfulJobsViewSubmissionIsProcessedFromThatProvider()
 {
     var options = new PublishOptions();
     await MessageSession.Publish <SubmissionJobSucceeded>(m =>
     {
         m.Ukprn = TestSession.Ukprn;
     }, options);
 }
 public async Task WhenThereIsAChangeAtApprovalsSide()
 {
     var options = new PublishOptions();
     await MessageSession.Publish <ApprenticeshipUpdated>(m =>
     {
         m.Ukprn = TestSession.Ukprn;
     }, options);
 }
 public async Task WhenNewUnsuccessfulSubmissionIsProcessedFromThatProvider()
 {
     var options = new PublishOptions();
     await MessageSession.Publish <SubmissionJobFailed>(m =>
     {
         m.Ukprn = TestSession.Ukprn;
     }, options);
 }
Exemplo n.º 6
0
        private async Task InnerPumpMessages()
        {
            while (!CancellationTokenSource.IsCancellationRequested)
            {
                await Task.Delay(1000, CancellationToken).ConfigureAwait(false);

                var eventMessage = new EventMessage {
                    MessageId = Guid.NewGuid()
                };
                _eventMessageRecorder.Record(eventMessage.MessageId);
                await MessageSession.Publish(eventMessage, new PublishOptions()).ConfigureAwait(false);

                await ConsoleUtilities.WriteLineAsyncWithColor(ConsoleColor.Blue, $"Published message: {eventMessage.MessageId}").ConfigureAwait(false);
            }
        }
 public async Task GivenTheProviderMakesASuccessfulSubmission(string submissionStatus)
 {
     // "failed" or "successful"
     if (submissionStatus.Equals("failed", StringComparison.OrdinalIgnoreCase))
     {
         await MessageSession.Publish <SubmissionJobFailed>(m =>
         {
             m.Ukprn = TestSession.Ukprn;
         });
     }
     else
     {
         Container.Resolve <TestPaymentsDataContext>().CreateSuccessfulSubmissionJob(TestSession.Ukprn, AcademicYear, CollectionPeriod);
         await MessageSession.Publish <SubmissionJobSucceeded>(m =>
         {
             m.Ukprn = TestSession.Ukprn;
         });
     }
 }
Exemplo n.º 8
0
        public async Task HandleRemovedLearner()
        {
            var payment = Context.Get <PaymentModel>(HistoricPayment);

            var removedLearnerEvent = new IdentifiedRemovedLearningAim
            {
                JobId            = TestSession.GenerateId(),
                CollectionPeriod = new CollectionPeriod {
                    AcademicYear = 1920, Period = 5
                },
                IlrSubmissionDateTime = DateTime.Now,
                Ukprn        = payment.Ukprn,
                ContractType = ContractType.Act2,
                LearningAim  = new LearningAim
                {
                    FrameworkCode   = 1,
                    FundingLineType = "funding line type",
                    PathwayCode     = 2,
                    ProgrammeType   = 3,
                    Reference       = "ZPROG001",
                    StandardCode    = 4,
                    StartDate       = DateTime.Now.AddMonths(-2),
                },
                Learner = new Learner
                {
                    ReferenceNumber = "abc",
                }
            };

            Context.Add(IdentifiedRemovedLearningAim, removedLearnerEvent);
            Context.Add(JobIds, new List <long> {
                removedLearnerEvent.JobId
            });

            await MessageSession.Publish(removedLearnerEvent);
        }
Exemplo n.º 9
0
 public async Task DuplicateEvent()
 {
     var identifiedRemovedLearningAimEvent = Context.Get <IdentifiedRemovedLearningAim>(IdentifiedRemovedLearningAim);
     await MessageSession.Publish(identifiedRemovedLearningAimEvent);
 }