本文整理汇总了C#中MonoTests.System.UnitTestUriParser._IsBaseOf方法的典型用法代码示例。如果您正苦于以下问题:C# UnitTestUriParser._IsBaseOf方法的具体用法?C# UnitTestUriParser._IsBaseOf怎么用?C# UnitTestUriParser._IsBaseOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.UnitTestUriParser
的用法示例。
在下文中一共展示了UnitTestUriParser._IsBaseOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsBaseOf_UriNull
public void IsBaseOf_UriNull ()
{
UnitTestUriParser p = new UnitTestUriParser ();
p._IsBaseOf (http, null);
}
示例2: IsBaseOf_NullUri
public void IsBaseOf_NullUri ()
{
UnitTestUriParser p = new UnitTestUriParser ();
p._IsBaseOf (null, http);
}
示例3: IsBaseOf
public void IsBaseOf ()
{
UnitTestUriParser p = new UnitTestUriParser ();
Assert.IsTrue (p._IsBaseOf (http, http), "http-http");
Uri u = new Uri ("http://www.mono-project.com/Main_Page#FAQ");
Assert.IsTrue (p._IsBaseOf (u, http), "http-1a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-1b");
u = new Uri ("http://www.mono-project.com/Main_Page");
Assert.IsTrue (p._IsBaseOf (u, http), "http-2a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-2b");
u = new Uri ("http://www.mono-project.com/");
Assert.IsTrue (p._IsBaseOf (u, http), "http-3a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-3b");
u = new Uri ("http://www.mono-project.com/Main_Page/");
Assert.IsFalse (p._IsBaseOf (u, http), "http-4a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-4b");
// docs says the UserInfo isn't evaluated, but...
u = new Uri ("http://username:[email protected]/Main_Page");
Assert.IsFalse (p._IsBaseOf (u, http), "http-5a");
Assert.IsFalse (p._IsBaseOf (http, u), "http-5b");
// scheme case sensitive ? no
u = new Uri ("HTTP://www.mono-project.com/Main_Page");
Assert.IsTrue (p._IsBaseOf (u, http), "http-6a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-6b");
// host case sensitive ? no
u = new Uri ("http://www.Mono-Project.com/Main_Page");
Assert.IsTrue (p._IsBaseOf (u, http), "http-7a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-7b");
// path case sensitive ? no
u = new Uri ("http://www.Mono-Project.com/MAIN_Page");
Assert.IsTrue (p._IsBaseOf (u, http), "http-8a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-8b");
// different scheme
u = new Uri ("ftp://www.mono-project.com/Main_Page");
Assert.IsFalse (p._IsBaseOf (u, http), "http-9a");
Assert.IsFalse (p._IsBaseOf (http, u), "http-9b");
// different host
u = new Uri ("http://www.go-mono.com/Main_Page");
Assert.IsFalse (p._IsBaseOf (u, http), "http-10a");
Assert.IsFalse (p._IsBaseOf (http, u), "http-10b");
// different port
u = new Uri ("http://www.mono-project.com:8080/");
Assert.IsFalse (p._IsBaseOf (u, http), "http-11a");
Assert.IsFalse (p._IsBaseOf (http, u), "http-11b");
// specify default port
u = new Uri ("http://www.mono-project.com:80/");
Assert.IsTrue (p._IsBaseOf (u, http), "http-12a");
Assert.IsTrue (p._IsBaseOf (http, u), "http-12b");
}