本文整理汇总了C#中TestHelper.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# TestHelper.Dispose方法的具体用法?C# TestHelper.Dispose怎么用?C# TestHelper.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelper
的用法示例。
在下文中一共展示了TestHelper.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_get_serialized_json_format
public void Should_get_serialized_json_format()
{
var testHelper = new TestHelper(authToken, storageUrl);
testHelper.PutItemInContainer(Constants.StorageItemNameJpg);
var getContainerInformation = new GetContainerInformationSerialized(storageUrl, Constants.CONTAINER_NAME, Format.JSON);
var jsonResponse = new GenerateRequestByType().Submit(getContainerInformation, authToken);
Assert.That(jsonResponse.Status, Is.EqualTo(HttpStatusCode.OK));
var jsonReturnValue = String.Join("", jsonResponse.ContentBody.ToArray());
jsonResponse.Dispose();
var expectedSubString = "[{\"name\":[ ]?\"" + Constants.StorageItemNameJpg + "\",[ ]?\"hash\":[ ]?\"b44a59383b3123a747d139bd0e71d2df\",[ ]?\"bytes\":[ ]?\\d+,[ ]?\"content_type\":[ ]?\"image.*jpeg\",[ ]?\"last_modified\":[ ]?\"" + String.Format("{0:yyyy-MM}", DateTime.Now);
Assert.That(Regex.Match(jsonReturnValue, expectedSubString).Success, Is.True);
testHelper.DeleteItemFromContainer(Constants.StorageItemNameJpg);
testHelper.Dispose();
}
示例2: Should_return_no_content_when_the_container_exists_and_the_name_contains_spaces
public void Should_return_no_content_when_the_container_exists_and_the_name_contains_spaces()
{
const string containerName = "I am making a funky container";
TestHelper testHelper = new TestHelper(authToken, storageUrl, containerName);
testHelper.PutItemInContainer(Constants.StorageItemName, Constants.StorageItemName);
var getContainerInformation = new GetContainerInformation(storageUrl, containerName);
var informationResponse = new GenerateRequestByType().Submit(getContainerInformation, authToken);
Assert.That(informationResponse.Status, Is.EqualTo(HttpStatusCode.NoContent));
Assert.That(informationResponse.Headers[Constants.XContainerObjectCount], Is.EqualTo("1"));
Assert.That(informationResponse.Headers[Constants.XContainerBytesUsed], (Is.Not.Null));
testHelper.DeleteItemFromContainer(Constants.StorageItemName);
testHelper.Dispose();
}