本文整理汇总了C#中NGit.Transport.URIish.SetPath方法的典型用法代码示例。如果您正苦于以下问题:C# URIish.SetPath方法的具体用法?C# URIish.SetPath怎么用?C# URIish.SetPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit.Transport.URIish
的用法示例。
在下文中一共展示了URIish.SetPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetURI
internal override URIish GetURI()
{
URIish u = new URIish();
u = u.SetScheme(TransportAmazonS3.S3_SCHEME);
u = u.SetHost(this.bucketName);
u = u.SetPath("/" + this.objectsKey);
return u;
}
示例2: TestGetSet
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));
}