本文整理汇总了C#中GitSharp.Core.Transport.URIish.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# URIish.ToString方法的具体用法?C# URIish.ToString怎么用?C# URIish.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitSharp.Core.Transport.URIish
的用法示例。
在下文中一共展示了URIish.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testWindowsFile2
public void testWindowsFile2()
{
const string str = "D:\\m y";
var u = new URIish(str);
Assert.IsNull(u.Scheme);
Assert.IsFalse(u.IsRemote);
Assert.AreEqual("D:/m y", u.Path);
Assert.AreEqual("D:/m y", u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例2: testFileProtoWindows
public void testFileProtoWindows()
{
const string str = "file:///D:/m y";
var u = new URIish(str);
Assert.AreEqual("file", u.Scheme);
Assert.IsFalse(u.IsRemote);
Assert.AreEqual("D:/m y", u.Path);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例3: testUnixFile
public void testUnixFile()
{
const string str = "/home/m y";
var u = new URIish(str);
Assert.IsNull(u.Scheme);
Assert.IsFalse(u.IsRemote);
Assert.AreEqual(str, u.Path);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例4: testAddURI
public void testAddURI()
{
readConfig(string.Empty);
URIish uri = new URIish("/some/dir");
RemoteConfig rc = new RemoteConfig(config, "backup");
Assert.AreEqual(0, rc.URIs.Count);
Assert.IsTrue(rc.AddURI(uri));
Assert.AreEqual(1, rc.URIs.Count);
Assert.AreSame(uri, rc.URIs[0]);
Assert.IsFalse(rc.AddURI(new URIish(uri.ToString())));
Assert.AreEqual(1, rc.URIs.Count);
}
示例5: TransportHttp
public TransportHttp(Repository local, URIish uri)
: base(local, uri)
{
try
{
string uriString = uri.ToString();
if (!uriString.EndsWith("/"))
{
uriString += "/";
}
_baseUrl = new Uri(uriString);
_objectsUrl = new Uri(_baseUrl, "objects/");
}
catch (UriFormatException e)
{
throw new NotSupportedException("Invalid URL " + uri, e);
}
}
示例6: testUNC
public void testUNC()
{
const string str = "\\\\some\\place";
var u = new URIish(str);
Assert.IsNull(u.Scheme);
Assert.IsFalse(u.IsRemote);
Assert.AreEqual("//some/place", u.Path);
Assert.AreEqual("//some/place", u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例7: testSshProtoWithUserPassAndPort
public void testSshProtoWithUserPassAndPort()
{
const string str = "ssh://user:[email protected]le.com:33/some/p ath";
var u = new URIish(str);
Assert.AreEqual("ssh", u.Scheme);
Assert.IsTrue(u.IsRemote);
Assert.AreEqual("/some/p ath", u.Path);
Assert.AreEqual("example.com", u.Host);
Assert.AreEqual("user", u.User);
Assert.AreEqual("pass", u.Pass);
Assert.AreEqual(33, u.Port);
Assert.AreEqual(str, u.ToPrivateString());
Assert.AreEqual(u.SetPass(null).ToPrivateString(), u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例8: testSshProto
public void testSshProto()
{
const string str = "ssh://example.com/some/p ath";
var u = new URIish(str);
Assert.AreEqual("ssh", u.Scheme);
Assert.IsTrue(u.IsRemote);
Assert.AreEqual("/some/p ath", u.Path);
Assert.AreEqual("example.com", u.Host);
Assert.AreEqual(-1, u.Port);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例9: testScpStyleWithUser
public void testScpStyleWithUser()
{
const string str = "[email protected]:some/p ath";
var u = new URIish(str);
Assert.IsNull(u.Scheme);
Assert.IsTrue(u.IsRemote);
Assert.AreEqual("some/p ath", u.Path);
Assert.AreEqual("user", u.User);
Assert.AreEqual("example.com", u.Host);
Assert.AreEqual(-1, u.Port);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例10: testGitProtoWindows
public void testGitProtoWindows()
{
const string str = "git://example.com/D:/m y";
var u = new URIish(str);
Assert.AreEqual("git", u.Scheme);
Assert.IsTrue(u.IsRemote);
Assert.AreEqual("D:/m y", u.Path);
Assert.AreEqual(-1, u.Port);
Assert.AreEqual("example.com", u.Host);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
示例11: testGitProtoUnixPort
public void testGitProtoUnixPort()
{
const string str = "git://example.com:333/home/m y";
var u = new URIish(str);
Assert.AreEqual("git", u.Scheme);
Assert.IsTrue(u.IsRemote);
Assert.AreEqual("example.com", u.Host);
Assert.AreEqual("/home/m y", u.Path);
Assert.AreEqual(333, u.Port);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}