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

            MockV2EventsPublisher.Verify(x =>
                x.PublishApprenticeshipStopDateChanged(_testCommitment, TestApprenticeship), Times.Once);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #5
0
        public async Task ThenShouldSendAnApprenticeshipPausedV2Event()
        {
            await Handler.Handle(ExampleValidRequest);

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