InnerPoll() private method

private InnerPoll ( CancellationToken cancellationToken ) : void
cancellationToken System.Threading.CancellationToken
return void
コード例 #1
0
        public void TestDispatchedTimeoutMessageIsRemoved()
        {
            // Arrange
            SetupProcessManagerFinderMock(DateTime.UtcNow.AddSeconds(30));
            var expiredTimeoutsPoller = new ExpiredTimeoutsPoller(_mockBus.Object);

            // Act
            expiredTimeoutsPoller.InnerPoll(new CancellationToken(false));

            // Assert
            _mockProcessManagerFinder.Verify(i => i.RemoveDispatchedTimeout(_tdId), Times.Once);
        }
コード例 #2
0
        public void TestNextQueryTimeIsResetToNextTimeoutDue()
        {
            // Arrange
            var nextTimeoutQueryTime = DateTime.UtcNow.AddSeconds(30);
            SetupProcessManagerFinderMock(nextTimeoutQueryTime);
            var expiredTimeoutsPoller = new ExpiredTimeoutsPoller(_mockBus.Object);

            // Act
            expiredTimeoutsPoller.InnerPoll(new CancellationToken(false));

            // Assert
            Assert.Equal(nextTimeoutQueryTime, expiredTimeoutsPoller.NextQueryUtc);
        }
コード例 #3
0
        public void TestNextQueryTimeIsResetToMaxAlowedValue()
        {
            // Arrange
            var nextTimeoutQueryTime = DateTime.UtcNow.AddDays(1);
            SetupProcessManagerFinderMock(nextTimeoutQueryTime);
            var expiredTimeoutsPoller = new ExpiredTimeoutsPoller(_mockBus.Object);

            // Act
            expiredTimeoutsPoller.InnerPoll(new CancellationToken(false));

            // Assert
            Assert.True(expiredTimeoutsPoller.NextQueryUtc < nextTimeoutQueryTime);
        }
コード例 #4
0
        public void TestTimeoutMessageIsDispatched()
        {
            // Arrange
            SetupProcessManagerFinderMock(DateTime.UtcNow.AddSeconds(30));
            var expiredTimeoutsPoller = new ExpiredTimeoutsPoller(_mockBus.Object);

            // Act
            expiredTimeoutsPoller.InnerPoll(new CancellationToken(false));

            // Assert
            _mockBus.Verify(i => i.Send("TestDest", It.Is<TimeoutMessage>(p => p.CorrelationId == _pmId), null), Times.Once);
        }