当前位置: 首页>>代码示例>>C#>>正文


C# UnitTestUriParser._GetComponents方法代码示例

本文整理汇总了C#中MonoTests.System.UnitTestUriParser._GetComponents方法的典型用法代码示例。如果您正苦于以下问题:C# UnitTestUriParser._GetComponents方法的具体用法?C# UnitTestUriParser._GetComponents怎么用?C# UnitTestUriParser._GetComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoTests.System.UnitTestUriParser的用法示例。


在下文中一共展示了UnitTestUriParser._GetComponents方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetComponents_BadUriFormat

		public void GetComponents_BadUriFormat ()
		{
			UnitTestUriParser p = new UnitTestUriParser ();
			p._GetComponents (http, UriComponents.Host, (UriFormat) Int32.MinValue);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:5,代码来源:UriParserTest.cs

示例2: GetComponents_BadUriComponents

		public void GetComponents_BadUriComponents ()
		{
			UnitTestUriParser p = new UnitTestUriParser ();
			Assert.AreEqual (full_http, p._GetComponents (http, (UriComponents) Int32.MinValue, UriFormat.SafeUnescaped), "http");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:5,代码来源:UriParserTest.cs

示例3: GetComponents_Ftp2

		public void GetComponents_Ftp2 ()
		{
			UnitTestUriParser p = new UnitTestUriParser ();
			Assert.AreEqual ("ftp", p._GetComponents (ftp2, UriComponents.Scheme, UriFormat.Unescaped), "ftp.Scheme");
			Assert.AreEqual ("username:password", p._GetComponents (ftp2, UriComponents.UserInfo, UriFormat.Unescaped), "ftp.UserInfo");
			Assert.AreEqual ("ftp.go-mono.com", p._GetComponents (ftp2, UriComponents.Host, UriFormat.Unescaped), "ftp.Host");
			Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.Port, UriFormat.Unescaped), "ftp.Port");
			Assert.AreEqual ("with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path, UriFormat.Unescaped), "ftp.Path");
			Assert.AreEqual ("with%20some%20spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path, UriFormat.UriEscaped), "ftp.Path-UriEscaped");
			Assert.AreEqual ("with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path, UriFormat.SafeUnescaped), "ftp.Path-SafeUnescaped");
			Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.Query, UriFormat.Unescaped), "ftp.Query");
			Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.Fragment, UriFormat.Unescaped), "ftp.Fragment");
			Assert.AreEqual ("21", p._GetComponents (ftp2, UriComponents.StrongPort, UriFormat.Unescaped), "ftp.StrongPort");
			Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.KeepDelimiter, UriFormat.Unescaped), "http.KeepDelimiter");
			Assert.AreEqual ("ftp.go-mono.com:21", p._GetComponents (ftp2, UriComponents.HostAndPort, UriFormat.Unescaped), "http.HostAndPort");
			Assert.AreEqual ("username:[email protected]:21", p._GetComponents (ftp2, UriComponents.StrongAuthority, UriFormat.Unescaped), "http.StrongAuthority");
			Assert.AreEqual ("ftp://username:[email protected]/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.AbsoluteUri, UriFormat.Unescaped), "http.AbsoluteUri");
			Assert.AreEqual ("/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.PathAndQuery, UriFormat.Unescaped), "http.PathAndQuery");
			Assert.AreEqual ("ftp://ftp.go-mono.com/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.HttpRequestUrl, UriFormat.Unescaped), "http.HttpRequestUrl");
			Assert.AreEqual ("ftp://ftp.go-mono.com", p._GetComponents (ftp2, UriComponents.SchemeAndServer, UriFormat.Unescaped), "http.SchemeAndServer");
			Assert.AreEqual ("ftp://username:[email protected]/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.SerializationInfoString, UriFormat.Unescaped), "http.SerializationInfoString");
			Assert.AreSame (p, p._OnNewUri (), "OnNewUri");
			// strange mixup
			Assert.AreEqual ("ftp://username:[email protected]", p._GetComponents (ftp2, UriComponents.Scheme | UriComponents.UserInfo, UriFormat.Unescaped), "ftp.Scheme+UserInfo");
			Assert.AreEqual (":21/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path | UriComponents.StrongPort, UriFormat.Unescaped), "ftp.Path+StrongPort");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:26,代码来源:UriParserTest.cs

示例4: GetComponents_Null

		public void GetComponents_Null ()
		{
			UnitTestUriParser p = new UnitTestUriParser ();
			p._GetComponents (null, UriComponents.Host, UriFormat.SafeUnescaped);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:5,代码来源:UriParserTest.cs

示例5: GetComponents

		public void GetComponents ()
		{
			UnitTestUriParser p = new UnitTestUriParser ();
			Assert.AreEqual ("http", p._GetComponents (http, UriComponents.Scheme, UriFormat.SafeUnescaped), "http.Scheme");
			Assert.AreEqual (String.Empty, p._GetComponents (http, UriComponents.UserInfo, UriFormat.SafeUnescaped), "http.UserInfo");
			Assert.AreEqual ("www.mono-project.com", p._GetComponents (http, UriComponents.Host, UriFormat.SafeUnescaped), "http.Host");
			Assert.AreEqual (String.Empty, p._GetComponents (http, UriComponents.Port, UriFormat.SafeUnescaped), "http.Port");
			Assert.AreEqual ("Main_Page", p._GetComponents (http, UriComponents.Path, UriFormat.SafeUnescaped), "http.Path");
			Assert.AreEqual (String.Empty, p._GetComponents (http, UriComponents.Query, UriFormat.SafeUnescaped), "http.Query");
			Assert.AreEqual ("FAQ?Edit", p._GetComponents (http, UriComponents.Fragment, UriFormat.SafeUnescaped), "http.Fragment");
			Assert.AreEqual ("80", p._GetComponents (http, UriComponents.StrongPort, UriFormat.SafeUnescaped), "http.StrongPort");
			Assert.AreEqual (String.Empty, p._GetComponents (http, UriComponents.KeepDelimiter, UriFormat.SafeUnescaped), "http.KeepDelimiter");
			Assert.AreEqual ("www.mono-project.com:80", p._GetComponents (http, UriComponents.HostAndPort, UriFormat.SafeUnescaped), "http.HostAndPort");
			Assert.AreEqual ("www.mono-project.com:80", p._GetComponents (http, UriComponents.StrongAuthority, UriFormat.SafeUnescaped), "http.StrongAuthority");
			Assert.AreEqual (full_http, p._GetComponents (http, UriComponents.AbsoluteUri, UriFormat.SafeUnescaped), "http.AbsoluteUri");
			Assert.AreEqual ("/Main_Page", p._GetComponents (http, UriComponents.PathAndQuery, UriFormat.SafeUnescaped), "http.PathAndQuery");
			Assert.AreEqual ("http://www.mono-project.com/Main_Page", p._GetComponents (http, UriComponents.HttpRequestUrl, UriFormat.SafeUnescaped), "http.HttpRequestUrl");
			Assert.AreEqual ("http://www.mono-project.com", p._GetComponents (http, UriComponents.SchemeAndServer, UriFormat.SafeUnescaped), "http.SchemeAndServer");
			Assert.AreEqual (full_http, p._GetComponents (http, UriComponents.SerializationInfoString, UriFormat.SafeUnescaped), "http.SerializationInfoString");
			// strange mixup
			Assert.AreEqual ("http://", p._GetComponents (http, UriComponents.Scheme | UriComponents.Port, UriFormat.SafeUnescaped), "http.Scheme+Port");
			Assert.AreEqual ("www.mono-project.com#FAQ?Edit", p._GetComponents (http, UriComponents.Host | UriComponents.Fragment, UriFormat.SafeUnescaped), "http.Scheme+Port");
			Assert.AreEqual ("/Main_Page", p._GetComponents (http, UriComponents.Port | UriComponents.Path, UriFormat.SafeUnescaped), "http.Scheme+Port");
			Assert.AreSame (p, p._OnNewUri (), "OnNewUri");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:25,代码来源:UriParserTest.cs


注:本文中的MonoTests.System.UnitTestUriParser._GetComponents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。