Exemple #1
0
        public void SetAzureBlobContentByNameTest()
        {
            string fileName      = string.Empty;
            string containerName = string.Empty;
            string blobName      = string.Empty;

            AssertThrows <ArgumentException>(() => command.SetAzureBlobContent(fileName, containerName, blobName));
            fileName = @"abcxx\xxxxabc";
            AssertThrows <ArgumentException>(() => command.SetAzureBlobContent(fileName, containerName, blobName));
            fileName = @"c:\Windows\System32\cmd.exe";
            AssertThrows <ArgumentException>(() => command.SetAzureBlobContent(fileName, containerName, blobName),
                                             String.Format(Resources.InvalidContainerName, containerName));
            containerName = "test";
            AssertThrows <ResourceNotFoundException>(() => command.SetAzureBlobContent(fileName, containerName, blobName),
                                                     String.Format(Resources.ContainerNotFound, containerName));
            AddTestContainers();
            command.SetAzureBlobContent(fileName, containerName, blobName);
        }