本文整理匯總了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");
}