本文整理匯總了C#中Agent.GetAzureStorageContainer方法的典型用法代碼示例。如果您正苦於以下問題:C# Agent.GetAzureStorageContainer方法的具體用法?C# Agent.GetAzureStorageContainer怎麽用?C# Agent.GetAzureStorageContainer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Agent
的用法示例。
在下文中一共展示了Agent.GetAzureStorageContainer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetContainerTest
internal void GetContainerTest(Agent agent)
{
string NEW_CONTAINER_NAME = Utility.GenNameString("astoria-");
Dictionary<string, object> dic = Utility.GenComparisonData(StorageObjectType.Container, NEW_CONTAINER_NAME);
// create container if it does not exist
CloudBlobContainer container = CommonStorageAccount.CreateCloudBlobClient().GetContainerReference(NEW_CONTAINER_NAME);
container.CreateIfNotExists();
Collection<Dictionary<string, object>> comp = new Collection<Dictionary<string, object>> { dic };
try
{
//--------------Get operation--------------
Test.Assert(agent.GetAzureStorageContainer(NEW_CONTAINER_NAME), Utility.GenComparisonData("GetAzureStorageContainer", true));
// Verification for returned values
container.FetchAttributes();
dic.Add("CloudBlobContainer", container);
CloudBlobUtil.PackContainerCompareData(container, dic);
agent.OutputValidation(comp);
}
finally
{
// clean up
container.DeleteIfExists();
}
}