public async Task ThenTheMessageIsReceivedFromTheQueue() { //Act await _levyDeclaration.RunAsync(_cancellationTokenSource.Token); //Assert _pollingMessageReceiver.Verify(x => x.ReceiveAsAsync <EmployerRefreshLevyQueueMessage>(), Times.Once); }
public async Task ThenWhenHmrcHaveUpdatedTheirEnglishFractionCalculationsIShouldUpdateTheLevyCalculations() { //Assign _mediator.Setup(x => x.SendAsync(It.Is <GetHMRCLevyDeclarationQuery>(c => c.EmpRef.Equals(ExpectedPayeRef)))).ReturnsAsync(GetHMRCLevyDeclarationResponseObjectMother.Create(ExpectedPayeRef)); _mediator.Setup(x => x.SendAsync(It.IsAny <GetEnglishFractionUpdateRequiredRequest>())) .ReturnsAsync(new GetEnglishFractionUpdateRequiredResponse { UpdateRequired = true }); //Act await _levyDeclaration.RunAsync(_cancellationTokenSource.Token); //Assert _mediator.Verify(x => x.SendAsync(It.IsAny <UpdateEnglishFractionsCommand>()), Times.Once); }