コード例 #1
0
        public async Task ThenTheMessageIsReceivedFromTheQueue()
        {
            //Act
            await _levyDeclaration.RunAsync(_cancellationTokenSource.Token);

            //Assert
            _pollingMessageReceiver.Verify(x => x.ReceiveAsAsync <EmployerRefreshLevyQueueMessage>(), Times.Once);
        }
コード例 #2
0
        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);
        }