本文整理匯總了C#中net.openstack.Providers.Rackspace.CloudFilesProvider.GetAccountHeaders方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudFilesProvider.GetAccountHeaders方法的具體用法?C# CloudFilesProvider.GetAccountHeaders怎麽用?C# CloudFilesProvider.GetAccountHeaders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.openstack.Providers.Rackspace.CloudFilesProvider
的用法示例。
在下文中一共展示了CloudFilesProvider.GetAccountHeaders方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Should_Get_Headers_For_Account
public void Should_Get_Headers_For_Account()
{
var provider = new CloudFilesProvider();
var accountHeadersResponse = provider.GetAccountHeaders(identity: _testIdentity);
Assert.IsNotNull(accountHeadersResponse);
Assert.IsTrue(accountHeadersResponse.ContainsKey("x-account-object-count"));
}
示例2: TestGetAccountHeaders
public void TestGetAccountHeaders()
{
IObjectStorageProvider provider = new CloudFilesProvider(Bootstrapper.Settings.TestIdentity);
Dictionary<string, string> headers = provider.GetAccountHeaders();
Assert.IsNotNull(headers);
Console.WriteLine("Account Headers:");
foreach (var pair in headers)
{
Assert.IsNotNull(pair.Key);
Assert.IsNotNull(pair.Value);
Assert.IsFalse(string.IsNullOrEmpty(pair.Key));
Console.WriteLine(" {0}: {1}", pair.Key, pair.Value);
}
Assert.AreEqual(StringComparer.OrdinalIgnoreCase, headers.Comparer);
string containerCountText;
Assert.IsTrue(headers.TryGetValue(CloudFilesProvider.AccountContainerCount, out containerCountText));
long containerCount;
Assert.IsTrue(long.TryParse(containerCountText, out containerCount));
Assert.IsTrue(containerCount >= 0);
string accountBytesText;
Assert.IsTrue(headers.TryGetValue(CloudFilesProvider.AccountBytesUsed, out accountBytesText));
long accountBytes;
Assert.IsTrue(long.TryParse(accountBytesText, out accountBytes));
Assert.IsTrue(accountBytes >= 0);
string objectCountText;
if (headers.TryGetValue(CloudFilesProvider.AccountObjectCount, out objectCountText))
{
// the X-Account-Object-Count header is optional, but when included should be a non-negative integer
long objectCount;
Assert.IsTrue(long.TryParse(objectCountText, out objectCount));
Assert.IsTrue(objectCount >= 0);
}
}