本文整理汇总了C#中TestHelper.AddMetadataToItem方法的典型用法代码示例。如果您正苦于以下问题:C# TestHelper.AddMetadataToItem方法的具体用法?C# TestHelper.AddMetadataToItem怎么用?C# TestHelper.AddMetadataToItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelper
的用法示例。
在下文中一共展示了TestHelper.AddMetadataToItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_get_200_OK_or_204_No_Content_when_item_exists
public void Should_get_200_OK_or_204_No_Content_when_item_exists()
{
using (var testHelper = new TestHelper(authToken, storageUrl))
{
try
{
testHelper.PutItemInContainer(Constants.HeadStorageItemName);
testHelper.AddMetadataToItem(Constants.HeadStorageItemName);
var getStorageItemInformation = new GetStorageItemInformation(storageUrl, Constants.CONTAINER_NAME, Constants.HeadStorageItemName);
var getStorageItemInformationResponse = new GenerateRequestByType().Submit(
getStorageItemInformation, authToken);
Assert.That(getStorageItemInformationResponse.Status == HttpStatusCode.OK
|| getStorageItemInformationResponse.Status == HttpStatusCode.NoContent, Is.True);
var metadata = getStorageItemInformationResponse.Metadata;
Assert.That(metadata["Test"], Is.EqualTo("test"));
Assert.That(metadata["Test2"], Is.EqualTo("test2"));
}
finally
{
testHelper.DeleteItemFromContainer(Constants.HeadStorageItemName);
}
}
}
示例2: Should_get_204_No_Content_when_item_exists
public void Should_get_204_No_Content_when_item_exists()
{
using (TestHelper testHelper = new TestHelper(authToken, storageUrl))
{
try
{
testHelper.PutItemInContainer(Constants.HeadStorageItemName);
testHelper.AddMetadataToItem(Constants.HeadStorageItemName);
var getStorageItemInformation = new GetStorageItemInformation(storageUrl, authToken, Constants.CONTAINER_NAME, Constants.HeadStorageItemName);
var getStorageItemInformationResponse = new ResponseFactory<CloudFilesResponse>().Create(new CloudFilesRequest(getStorageItemInformation));
Assert.That(getStorageItemInformationResponse.Status, Is.EqualTo(HttpStatusCode.NoContent));
var metadata = getStorageItemInformationResponse.Metadata;
Assert.That(metadata["Test"], Is.EqualTo("test"));
Assert.That(metadata["Test2"], Is.EqualTo("test2"));
}
finally
{
testHelper.DeleteItemFromContainer(Constants.HeadStorageItemName);
}
}
}