コード例 #1
0
        public async Task GetMessages_QueueCheckThrowsTransientError_ReturnsBackoffResult()
        {
            CancellationToken cancellationToken = new CancellationToken();
            var exception = new StorageException(
                new RequestResult
            {
                HttpStatusCode = 503
            },
                string.Empty,
                new Exception());

            _mockQueue.Setup(p => p.GetMessagesAsync(It.IsAny <int>(), It.IsAny <TimeSpan>(), null, null, cancellationToken)).Throws(exception);

            var result = await _listener.ExecuteAsync(cancellationToken);

            Assert.NotNull(result);
            await result.Wait;
        }