public async Task EnqueuePostsQueueAndBlobWithVisibilityDelay()
{
// Arrange
var queue = new LargeMessageQueue<TestQueueItem>(_queueSerializerMock.Object, _referenceQueueMock.Object, _blobRepository.Object, _loggerMock.Object, null);
var item = new TestQueueItem { Name = "Zaphod" };
var mockBlob = new Mock<IBlob>();
string blobName = null;
_blobRepository.Setup(x => x.UploadAsync(It.IsAny<string>(), It.IsAny<Stream>()))
.Returns(Task.FromResult(mockBlob.Object))
.Callback((string n, Stream s) =>
{
// capture the blob name to ensure the queue item gets posted with the correct blob reference
blobName = n;
});
var timespan = TimeSpan.FromSeconds(30);
// Act
await queue.EnqueueAsync(item, timespan);
// Assert
_referenceQueueMock.Verify(x => x.EnqueueAsync(It.Is<LargeMessageReference>(v => v.BlobReference == blobName), timespan, null));
}