本文整理汇总了C#中System.Uri.ParentUriString方法的典型用法代码示例。如果您正苦于以下问题:C# Uri.ParentUriString方法的具体用法?C# Uri.ParentUriString怎么用?C# Uri.ParentUriString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Uri
的用法示例。
在下文中一共展示了Uri.ParentUriString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParentUriString_should_return_self_if_already_parent
public void ParentUriString_should_return_self_if_already_parent()
{
var url = "http://www.nzbdrone.com";
var uri = new Uri(url);
var result = uri.ParentUriString();
//Resolve
result.Should().Be(url);
}
示例2: ParentUriString_should_return_parent_url_when_url_with_query_strings_is_passed
public void ParentUriString_should_return_parent_url_when_url_with_query_strings_is_passed()
{
var url = "http://www.nzbdrone.com/test.aspx?test=10&test2=5";
var uri = new Uri(url);
var result = uri.ParentUriString();
//Resolve
result.Should().Be("http://www.nzbdrone.com");
}
示例3: ParentUriString_should_return_parent_url_when_multiple_paths_are_passed
public void ParentUriString_should_return_parent_url_when_multiple_paths_are_passed()
{
var url = "http://www.nzbdrone.com/test/test2";
var uri = new Uri(url);
var result = uri.ParentUriString();
//Resolve
result.Should().Be("http://www.nzbdrone.com");
}
示例4: ParentUriString_should_return_parent_url_when_url_with_path_and_query_strings_is_passed
public void ParentUriString_should_return_parent_url_when_url_with_path_and_query_strings_is_passed()
{
var url = "http://www.sonarr.tv/tester/test.aspx?test=10";
var uri = new Uri(url);
var result = uri.ParentUriString();
//Resolve
result.Should().Be("http://www.sonarr.tv");
}
示例5: ParentUriString_should_return_parent_url_when_path_is_passed
public void ParentUriString_should_return_parent_url_when_path_is_passed()
{
var url = "http://www.sonarr.tv/test/";
var uri = new Uri(url);
var result = uri.ParentUriString();
//Resolve
result.Should().Be("http://www.sonarr.tv");
}
示例6: ParentUriString_should_return_parent_url_when_path_is_passed
public void ParentUriString_should_return_parent_url_when_path_is_passed()
{
//Setup
var url = "http://www.nzbdrone.com/test/";
var uri = new Uri(url);
//Act
var result = uri.ParentUriString();
//Resolve
result.Should().Be("http://www.nzbdrone.com");
}