public CrossAccountBlobTransferTests() { sourceBlob = CreateCloudBlockBlob(); targetBlob = CreateCloudBlockBlob(); targetContainer = CreateCloudBlobContainer(); blobCopyService = Mock.Of <IBlobCopyService>(); logger = Mock.Of <ILogger>(); Mock.Get(targetContainer) .Setup(x => x.GetBlockBlobReference(TargetContainerName)) .Returns(targetBlob); Mock.Get(targetBlob) .Setup(x => x.ExistsAsync()) .Returns(Task.FromResult(true)); Mock.Get(sourceBlob) .Setup(x => x.Name) .Returns(SourceBlobName); Mock.Get(targetBlob) .Setup(x => x.Name) .Returns(SourceBlobName); Mock.Get(blobCopyService) .Setup(x => x.CopyAsync(targetBlob, It.IsAny <Uri>())) .Returns(Task.FromResult(CopyStatus.Success)); Mock.Get(blobCopyService) .Setup(x => x.SetAccessTierAsync(targetBlob, StandardBlobTier.Cool)) .Returns(Task.FromResult(true)); }
public CrossAccountBlobTransfer(IBlobCopyService blobCopyService) { this.blobCopyService = blobCopyService; }