public void RemoveAzureBlobByCloudBlobContainerSuccessfullyTest() { AddTestBlobs(); CloudBlobContainer container = BlobMock.GetContainerReference("container1"); string blobName = "blob0"; RunAsyncCommand(() => command.RemoveAzureBlob(InitTaskId, BlobMock, container, blobName).Wait()); AssertThrowsAsync<ResourceNotFoundException>(() => command.RemoveAzureBlob(InitTaskId, BlobMock, container, blobName), String.Format(Resources.BlobNotFound, blobName, "container1")); }
public void RemoveAzureBlobByCloudBlobContainerWithNotExistsBlobTest() { AddTestContainers(); CloudBlobContainer container = BlobMock.GetContainerReference("test"); string blobName = "test"; AssertThrowsAsync <ResourceNotFoundException>(() => command.RemoveAzureBlob(InitTaskId, BlobMock, container, blobName), String.Format(Resources.BlobNotFound, blobName, container.Name)); }
public void RemoveAzureBlobByICloudBlobWithNoExistsContainer() { CloudBlobContainer container = BlobMock.GetContainerReference("test"); CloudBlockBlob blockBlob = container.GetBlockBlobReference("blob"); command.RemoveAzureBlob(blockBlob, true); AssertThrows <ResourceNotFoundException>(() => command.RemoveAzureBlob(blockBlob, false), String.Format(Resources.ContainerNotFound, blockBlob.Container.Name)); }
public void GetBlobContentByContainerWithNotExistBlobTest() { AddTestContainers(); CloudBlobContainer container = BlobMock.GetContainerReference("test"); string blobName = "blob0"; string fileName = string.Empty; AssertThrows <ResourceNotFoundException>(() => command.GetBlobContent(container, blobName, fileName), String.Format(Resources.BlobNotFound, blobName, container.Name)); }
public void ValidatePipelineCloudBlobContainerTest() { CloudBlobContainer container = null; AssertThrows<ArgumentException>(()=>command.ValidatePipelineCloudBlobContainer(container), String.Format(Resources.ObjectCannotBeNull, typeof(CloudBlobContainer).Name)); container = BlobMock.GetContainerReference("t"); AssertThrows<ArgumentException>(() => command.ValidatePipelineCloudBlobContainer(container), String.Format(Resources.InvalidContainerName, "t")); AddTestContainers(); container = BlobMock.GetContainerReference("text"); command.ValidatePipelineCloudBlobContainer(container); }
public void GetBlobContentByContainerSuccessfullyTest() { AddTestBlobs(); CloudBlobContainer container = BlobMock.GetContainerReference("container20"); string blobName = "blob10"; string fileName = string.Empty; AzureStorageBlob blob = command.GetBlobContent(container, blobName, fileName); Assert.AreEqual("blob10", blob.Name); container = BlobMock.GetContainerReference("container20"); blobName = "blob10"; fileName = GetUniqueString(); blob = command.GetBlobContent(container, blobName, fileName); Assert.AreEqual("blob10", blob.Name); }
public void SetAzureBlobContentByContianerTest() { string fileName = string.Empty; string containerName = string.Empty; string blobName = string.Empty; CloudBlobContainer container = null; AssertThrows <ArgumentException>(() => command.SetAzureBlobContent(fileName, container, blobName)); fileName = @"c:\Windows\System32\cmd.exe"; container = BlobMock.GetContainerReference(containerName); AssertThrows <ArgumentException>(() => command.SetAzureBlobContent(fileName, container, blobName), String.Format(Resources.InvalidContainerName, container.Name)); AddTestContainers(); container = BlobMock.GetContainerReference("test"); command.SetAzureBlobContent(fileName, container, blobName); command.BlobType = "page"; command.SetAzureBlobContent(fileName, container, blobName); }
public void ValidatePipelineCloudBlobContainerWithNotExistsContainerTest() { CloudBlobContainer container = BlobMock.GetContainerReference("test"); AssertThrows <ResourceNotFoundException>(() => command.ValidatePipelineCloudBlobContainer(container), String.Format(Resources.ContainerNotFound, container.Name)); }