本文整理汇总了C#中HttpHeaderValueCollection.ParseAdd方法的典型用法代码示例。如果您正苦于以下问题:C# HttpHeaderValueCollection.ParseAdd方法的具体用法?C# HttpHeaderValueCollection.ParseAdd怎么用?C# HttpHeaderValueCollection.ParseAdd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpHeaderValueCollection
的用法示例。
在下文中一共展示了HttpHeaderValueCollection.ParseAdd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseAdd_AddValues_AllValuesAdded
public void ParseAdd_AddValues_AllValuesAdded()
{
MockHeaders headers = new MockHeaders(knownHeader, new MockHeaderParser(typeof(Uri)));
HttpHeaderValueCollection<Uri> collection = new HttpHeaderValueCollection<Uri>(knownHeader, headers,
specialValue);
collection.ParseAdd("http://www.example.org/1/");
collection.ParseAdd("http://www.example.org/2/");
collection.ParseAdd("http://www.example.org/3/");
Assert.Equal(3, collection.Count);
}
示例2: ParseAdd_UseSpecialValue_Added
public void ParseAdd_UseSpecialValue_Added()
{
MockHeaders headers = new MockHeaders(knownHeader, new MockHeaderParser(typeof(Uri)));
HttpHeaderValueCollection<Uri> collection = new HttpHeaderValueCollection<Uri>(knownHeader, headers,
specialValue);
collection.ParseAdd(specialValue.AbsoluteUri);
Assert.True(collection.IsSpecialValueSet);
Assert.Equal(specialValue.ToString(), collection.ToString());
}
示例3: ParseAdd_CallWithNullValue_NothingAdded
public void ParseAdd_CallWithNullValue_NothingAdded()
{
MockHeaders headers = new MockHeaders(knownHeader, new MockHeaderParser(typeof(Uri)));
HttpHeaderValueCollection<Uri> collection = new HttpHeaderValueCollection<Uri>(knownHeader, headers);
collection.ParseAdd(null);
Assert.False(collection.IsSpecialValueSet);
Assert.Equal(0, collection.Count);
Assert.Equal(String.Empty, collection.ToString());
}