public virtual void TestGetSet()
        {
            string str = "ssh://DOMAIN\\user:[email protected]:33/some/p ath%20";
            URIish u   = new URIish(str);

            u = u.SetHost(u.GetHost());
            u = u.SetPass(u.GetPass());
            u = u.SetPort(u.GetPort());
            NUnit.Framework.Assert.AreEqual("ssh", u.GetScheme());
            NUnit.Framework.Assert.IsTrue(u.IsRemote());
            u = u.SetRawPath(u.GetRawPath());
            NUnit.Framework.Assert.AreEqual("/some/p ath%20", u.GetRawPath());
            u = u.SetPath(u.GetPath());
            NUnit.Framework.Assert.AreEqual("/some/p ath ", u.GetRawPath());
            NUnit.Framework.Assert.AreEqual("/some/p ath ", u.GetPath());
            NUnit.Framework.Assert.AreEqual("example.com", u.GetHost());
            NUnit.Framework.Assert.AreEqual("DOMAIN\\user", u.GetUser());
            NUnit.Framework.Assert.AreEqual("pass", u.GetPass());
            NUnit.Framework.Assert.AreEqual(33, u.GetPort());
            NUnit.Framework.Assert.AreEqual("ssh://DOMAIN\\user:[email protected]:33/some/p ath "
                                            , u.ToPrivateString());
            NUnit.Framework.Assert.AreEqual("ssh://DOMAIN\\user:[email protected]:33/some/p%20ath%20"
                                            , u.ToPrivateASCIIString());
            NUnit.Framework.Assert.AreEqual(u.SetPass(null).ToPrivateString(), u.ToString());
            NUnit.Framework.Assert.AreEqual(u.SetPass(null).ToPrivateASCIIString(), u.ToASCIIString
                                                ());
            NUnit.Framework.Assert.AreEqual(u, new URIish(str));
        }
Exemplo n.º 2
0
		public virtual void TestGetSet()
		{
			string str = "ssh://DOMAIN\\user:[email protected]:33/some/p ath%20";
			URIish u = new URIish(str);
			u = u.SetHost(u.GetHost());
			u = u.SetPass(u.GetPass());
			u = u.SetPort(u.GetPort());
			NUnit.Framework.Assert.AreEqual("ssh", u.GetScheme());
			NUnit.Framework.Assert.IsTrue(u.IsRemote());
			u = u.SetRawPath(u.GetRawPath());
			NUnit.Framework.Assert.AreEqual("/some/p ath%20", u.GetRawPath());
			u = u.SetPath(u.GetPath());
			NUnit.Framework.Assert.AreEqual("/some/p ath ", u.GetRawPath());
			NUnit.Framework.Assert.AreEqual("/some/p ath ", u.GetPath());
			NUnit.Framework.Assert.AreEqual("example.com", u.GetHost());
			NUnit.Framework.Assert.AreEqual("DOMAIN\\user", u.GetUser());
			NUnit.Framework.Assert.AreEqual("pass", u.GetPass());
			NUnit.Framework.Assert.AreEqual(33, u.GetPort());
			NUnit.Framework.Assert.AreEqual("ssh://DOMAIN\\user:[email protected]:33/some/p ath "
				, u.ToPrivateString());
			NUnit.Framework.Assert.AreEqual("ssh://DOMAIN\\user:[email protected]:33/some/p%20ath%20"
				, u.ToPrivateASCIIString());
			NUnit.Framework.Assert.AreEqual(u.SetPass(null).ToPrivateString(), u.ToString());
			NUnit.Framework.Assert.AreEqual(u.SetPass(null).ToPrivateASCIIString(), u.ToASCIIString
				());
			NUnit.Framework.Assert.AreEqual(u, new URIish(str));
		}