public async Task ThenShouldPublishV2PublishApprenticeshipStopDateChangedEvent()
        {
            await Handler.Handle(ExampleValidRequest);

            MockV2EventsPublisher.Verify(x =>
                x.PublishApprenticeshipStopDateChanged(_testCommitment, TestApprenticeship), Times.Once);
        }
Esempio n. 2
0
        public void ThenWhenApprenticeshipNotInValidStateRequestThrowsExceptionAndNoV2ApprenticeshipResumedEventPublished(PaymentStatus initial)
        {
            TestApprenticeship.PaymentStatus = initial;

            Func <Task> act = async() => await Handler.Handle(ExampleValidRequest);

            act.ShouldThrow <Exception>();

            MockV2EventsPublisher.Verify(x => x.PublishApprenticeshipResumed(
                                             It.IsAny <Commitment>(),
                                             It.IsAny <Apprenticeship>()), Times.Never);
        }
Esempio n. 3
0
        public async Task ThenShouldPublishAV2ApprenticeshipResumedEvent()
        {
            await Handler.Handle(ExampleValidRequest);

            MockV2EventsPublisher.Verify(x => x.PublishApprenticeshipResumed(_testCommitment, TestApprenticeship));
        }
        public async Task ThenShouldSendAnApprenticeshipStoppedV2Event()
        {
            await Handler.Handle(ExampleValidRequest);

            MockV2EventsPublisher.Verify(x => x.PublishApprenticeshipStopped(It.IsAny <Commitment>(), It.IsAny <Apprenticeship>()), Times.Once);
        }
Esempio n. 5
0
        public async Task ThenShouldSendAnApprenticeshipPausedV2Event()
        {
            await Handler.Handle(ExampleValidRequest);

            MockV2EventsPublisher.Verify(x => x.PublishApprenticeshipPaused(_testCommitment, TestApprenticeship), Times.Once);
        }