public async Task GetAsync_BlobNameGiven_ReturnsStream() { string blobName = NewRandomString(); MemoryStream memoryStream = new MemoryStream(0); _cloudBlob.Setup(_ => _.OpenReadAsync(null, null, null)) .ReturnsAsync(memoryStream); _blobContainerRepository .Setup(_ => _.GetBlobReferenceFromServerAsync(blobName, It.IsAny <string>())) .ReturnsAsync(_cloudBlob.Object); Stream stream = await _blobClient.GetAsync(blobName); _blobContainerRepository.Verify(_ => _.GetBlobReferenceFromServerAsync(blobName, It.IsAny <string>())); stream .Should() .Be(memoryStream); }