本文整理汇总了C#中BlobServiceClient.GetBlobMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# BlobServiceClient.GetBlobMetadata方法的具体用法?C# BlobServiceClient.GetBlobMetadata怎么用?C# BlobServiceClient.GetBlobMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlobServiceClient
的用法示例。
在下文中一共展示了BlobServiceClient.GetBlobMetadata方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBlobMetadata_InvalidLeaseProvided_ThrowsArgumentException
public void GetBlobMetadata_InvalidLeaseProvided_ThrowsArgumentException()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
client.GetBlobMetadata(containerName, blobName, InvalidLeaseId);
// throws exception
}
示例2: GetBlobMetadata_LeasedBlobWithMetadataNoLeaseProvided_GetsMetadata
public void GetBlobMetadata_LeasedBlobWithMetadataNoLeaseProvided_GetsMetadata()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
var expectedMetadata = new Dictionary<string, string>
{
{"CaptainAmerica", "Shield"},
{"Thor", "Hammer"},
{"Me", "Code"}
};
_util.CreateContainer(containerName);
_util.CreateBlockBlob(containerName, blobName, expectedMetadata);
_util.LeaseBlob(containerName, blobName);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
var response = client.GetBlobMetadata(containerName, blobName);
Assert.AreEqual(expectedMetadata, response.Metadata);
}
示例3: BlobServiceClient
public void GetBlobMetadata_LeasedBlobWithMetadataIncorrectLeaseProvided_ThrowsLeaseIdMismatchWithBlobOperationAzureException()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
var expectedMetadata = new Dictionary<string, string>
{
{"CaptainAmerica", "Shield"},
{"Thor", "Hammer"},
{"Me", "Code"}
};
_util.CreateContainer(containerName);
_util.CreateBlockBlob(containerName, blobName, expectedMetadata);
_util.LeaseBlob(containerName, blobName);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
client.GetBlobMetadata(containerName, blobName, FakeLeaseId);
// throws exception
}
示例4: GetBlobMetadata_ExistingBlobWithNoMetadata_GetsEmptyMetadata
public void GetBlobMetadata_ExistingBlobWithNoMetadata_GetsEmptyMetadata()
{
var containerName = _util.GenerateSampleContainerName(_runId);
var blobName = _util.GenerateSampleBlobName(_runId);
var expectedMetadata = new Dictionary<string, string>();
_util.CreateContainer(containerName);
_util.CreateBlockBlob(containerName, blobName);
IBlobServiceClient client = new BlobServiceClient(AccountSettings);
var response = client.GetBlobMetadata(containerName, blobName);
Assert.AreEqual(expectedMetadata, response.Metadata);
}