Пример #1
0
        public void ShowNonExistingContainer()
        {
            string containerName = Utility.GenNameString("nonexisting");

            // Delete the container if it exists
            CloudBlobClient    blobClient = StorageAccount.CreateCloudBlobClient();
            CloudBlobContainer container  = blobClient.GetContainerReference(containerName);

            container.DeleteIfExists();

            NodeJSAgent nodejsAgent = (NodeJSAgent)CommandAgent;

            //--------------Show operation--------------
            Test.Assert(!nodejsAgent.ShowAzureStorageContainer(containerName), Utility.GenComparisonData("show container", false));
            // Verification for returned values
            nodejsAgent.ValidateErrorMessage(MethodBase.GetCurrentMethod().Name, containerName);
        }
Пример #2
0
        public void ShowNonExistingBlob()
        {
            string             containerName = Utility.GenNameString("container");
            string             blobName      = Utility.GenNameString("blob", 12);
            CloudBlobContainer container     = blobUtil.CreateContainer(containerName);

            NodeJSAgent nodejsAgent = (NodeJSAgent)CommandAgent;

            try
            {
                string notExistingBlobName = "notexistingblob";
                string BLOB_NAME           = Utility.GenNameString("nonexisting");

                Test.Assert(!nodejsAgent.ShowAzureStorageBlob(notExistingBlobName, containerName), Utility.GenComparisonData("show blob with not existing blob", false));
                nodejsAgent.ValidateErrorMessage(MethodBase.GetCurrentMethod().Name, notExistingBlobName, containerName);
            }
            finally
            {
                blobUtil.RemoveContainer(containerName);
            }
        }
Пример #3
0
        internal void StorageTest(string caseName)
        {
            NodeJSAgent nodeAgent     = (NodeJSAgent)CommandAgent;
            string      containerName = Utility.GenNameString("astoria-");
            string      blobName      = Utility.GenNameString("astoria-");

            Test.Assert(!nodeAgent.NewAzureStorageContainer(containerName), Utility.GenComparisonData("NewAzureStorageContainer", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.GetAzureStorageContainer(containerName), Utility.GenComparisonData("GetAzureStorageContainer", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.SetAzureStorageContainerACL(containerName, BlobContainerPublicAccessType.Container),
                        Utility.GenComparisonData("SetAzureStorageContainerACL", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.RemoveAzureStorageContainer(containerName), Utility.GenComparisonData("RemoveAzureStorageContainer", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.ShowAzureStorageContainer(containerName), Utility.GenComparisonData("ShowAzureStorageContainer", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.SetAzureStorageBlobContent(TempTestFile, containerName, BlobType.BlockBlob, blobName),
                        Utility.GenComparisonData("SetAzureStorageBlobContent", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.SetAzureStorageBlobContent(TempTestFile, containerName, BlobType.PageBlob, blobName),
                        Utility.GenComparisonData("SetAzureStorageBlobContent", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.GetAzureStorageBlobContent(blobName, TempTestFile, containerName),
                        Utility.GenComparisonData("GetAzureStorageBlobContent", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.GetAzureStorageBlob(blobName, containerName),
                        Utility.GenComparisonData("GetAzureStorageBlob", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.ShowAzureStorageBlob(blobName, containerName),
                        Utility.GenComparisonData("ShowAzureStorageBlob", false));
            nodeAgent.ValidateErrorMessage(caseName);

            Test.Assert(!nodeAgent.RemoveAzureStorageBlob(blobName, containerName),
                        Utility.GenComparisonData("RemoveAzureStorageBlob", false));
            nodeAgent.ValidateErrorMessage(caseName);
        }