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