ToString() public method

public ToString ( ) : string
return string
Exemplo n.º 1
0
		public void UrlMembershipCondition_GoMonoWebUrl () 
		{
			UrlMembershipCondition umc = new UrlMembershipCondition ("http://www.go-mono.com/");
			Assert.AreEqual ("http://www.go-mono.com/", umc.Url, "Url");
			Assert.AreEqual ("Url - http://www.go-mono.com/", umc.ToString (), "ToString");

			UrlMembershipCondition umc2 = (UrlMembershipCondition) umc.Copy ();
			Assert.AreEqual (umc.Url, umc2.Url, "Copy.Url");
			Assert.AreEqual (umc.GetHashCode (), umc2.GetHashCode (), "Copy.GetHashCode");

			SecurityElement se = umc2.ToXml ();
			UrlMembershipCondition umc3 = new UrlMembershipCondition ("*");
			umc3.FromXml (se);
			Assert.AreEqual (umc.Url, umc3.Url, "ToXml/FromXml");

			Assert.IsTrue (umc.Equals (umc2), "Equals");
			UrlMembershipCondition umc4 = new UrlMembershipCondition ("http://www.go-mono.com");
			// note that a last slash is added to Url - so it's equal
			Assert.IsTrue (umc.Equals (umc4), "Equals-AutoAddedLastSlash");
		}
Exemplo n.º 2
0
		public void Url_AllGoMonoUrl () 
		{
			UrlMembershipCondition umc = new UrlMembershipCondition ("http://www.go-mono.com/*");
			Assert.AreEqual ("http://www.go-mono.com/*", umc.Url, "Url");
			Assert.AreEqual ("Url - http://www.go-mono.com/*", umc.ToString (), "ToString");

			UrlMembershipCondition umc2 = (UrlMembershipCondition) umc.Copy ();
			Assert.AreEqual (umc.Url, umc2.Url, "Copy.Url");
			Assert.AreEqual (umc.GetHashCode (), umc2.GetHashCode (), "Copy.GetHashCode");

			SecurityElement se = umc2.ToXml ();
			UrlMembershipCondition umc3 = new UrlMembershipCondition ("*");
			umc3.FromXml (se);
			Assert.AreEqual (umc.Url, umc3.Url, "ToXml/FromXml");

			Assert.IsTrue (umc.Equals (umc2), "Equals");
			UrlMembershipCondition umc4 = new UrlMembershipCondition ("http://www.go-mono.com/");
			Assert.IsTrue (umc.Equals (umc4), "Equals-*");
		}
Exemplo n.º 3
0
		public void Url_RelativePath () 
		{
			UrlMembershipCondition umc = new UrlMembershipCondition ("http://www.go-mono.com/path/../newpath/index.html");
			Assert.AreEqual ("http://www.go-mono.com/path/../newpath/index.html", umc.Url, "Url");
			Assert.AreEqual ("Url - http://www.go-mono.com/path/../newpath/index.html", umc.ToString (), "ToString");
		}
Exemplo n.º 4
0
		public void Url_UnknownProtocol () 
		{
			UrlMembershipCondition umc = new UrlMembershipCondition ("mono://www.go-mono.com");
			Assert.AreEqual ("mono://www.go-mono.com", umc.Url, "Url");
			Assert.AreEqual ("Url - mono://www.go-mono.com", umc.ToString (), "ToString");
		}
Exemplo n.º 5
0
		public void Url_WellKnownProtocol () 
		{
			UrlMembershipCondition umc = new UrlMembershipCondition ("http://www.go-mono.com");
			Assert.AreEqual ("http://www.go-mono.com", umc.Url, "http-Url");
			Assert.AreEqual ("Url - http://www.go-mono.com", umc.ToString (), "http-ToString");
			umc = new UrlMembershipCondition ("https://www.go-mono.com");
			Assert.AreEqual ("https://www.go-mono.com", umc.Url, "https-Url");
			Assert.AreEqual ("Url - https://www.go-mono.com", umc.ToString (), "https-ToString");

			umc = new UrlMembershipCondition ("ftp://www.go-mono.com");
			Assert.AreEqual ("ftp://www.go-mono.com", umc.Url, "ftp-Url");
			Assert.AreEqual ("Url - ftp://www.go-mono.com", umc.ToString (), "ftp-ToString");

			umc = new UrlMembershipCondition ("file://www.go-mono.com");
			Assert.AreEqual ("file://www.go-mono.com", umc.Url, "file-Url");
			Assert.AreEqual ("Url - file://www.go-mono.com", umc.ToString (), "file-ToString");
		}
Exemplo n.º 6
0
		public void Url_WellKnownProtocol () 
		{
			UrlMembershipCondition umc = new UrlMembershipCondition ("http://www.go-mono.com");
#if NET_2_0
			Assert.AreEqual ("http://www.go-mono.com", umc.Url, "http-Url");
			Assert.AreEqual ("Url - http://www.go-mono.com", umc.ToString (), "http-ToString");
#else
			Assert.AreEqual ("http://www.go-mono.com/", umc.Url, "http-Url");
			Assert.AreEqual ("Url - http://www.go-mono.com/", umc.ToString (), "http-ToString");
#endif
			umc = new UrlMembershipCondition ("https://www.go-mono.com");
#if NET_2_0
			Assert.AreEqual ("https://www.go-mono.com", umc.Url, "https-Url");
			Assert.AreEqual ("Url - https://www.go-mono.com", umc.ToString (), "https-ToString");
#else
			Assert.AreEqual ("https://www.go-mono.com/", umc.Url, "https-Url");
			Assert.AreEqual ("Url - https://www.go-mono.com/", umc.ToString (), "https-ToString");
#endif

			umc = new UrlMembershipCondition ("ftp://www.go-mono.com");
#if NET_2_0
			Assert.AreEqual ("ftp://www.go-mono.com", umc.Url, "ftp-Url");
			Assert.AreEqual ("Url - ftp://www.go-mono.com", umc.ToString (), "ftp-ToString");
#else
			Assert.AreEqual ("ftp://www.go-mono.com/", umc.Url, "ftp-Url");
			Assert.AreEqual ("Url - ftp://www.go-mono.com/", umc.ToString (), "ftp-ToString");
#endif

			umc = new UrlMembershipCondition ("file://www.go-mono.com");
#if NET_2_0
			Assert.AreEqual ("file://www.go-mono.com", umc.Url, "file-Url");
			Assert.AreEqual ("Url - file://www.go-mono.com", umc.ToString (), "file-ToString");
#else
			Assert.AreEqual ("file://WWW.GO-MONO.COM", umc.Url, "file-Url");
			Assert.AreEqual ("Url - file://WWW.GO-MONO.COM", umc.ToString (), "file-ToString");
#endif
		}
Exemplo n.º 7
0
		public void Url_NoProtocol () 
		{
			UrlMembershipCondition umc = new UrlMembershipCondition ("www.go-mono.com");
#if NET_2_0
			Assert.AreEqual ("www.go-mono.com", umc.Url, "Url");
			Assert.AreEqual ("Url - www.go-mono.com", umc.ToString (), "ToString");
#else
			// note: no last slash here
			Assert.AreEqual ("file://WWW.GO-MONO.COM", umc.Url, "Url");
			Assert.AreEqual ("Url - file://WWW.GO-MONO.COM", umc.ToString (), "ToString");
#endif
		}