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


C# URIish.ToString方法代码示例

本文整理汇总了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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:10,代码来源:URIishTests.cs

示例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));
 }
开发者ID:nestalk,项目名称:GitSharp,代码行数:10,代码来源:URIishTests.cs

示例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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:10,代码来源:URIishTests.cs

示例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);
        }
开发者ID:georgeck,项目名称:GitSharp,代码行数:15,代码来源:RemoteConfigTests.cs

示例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);
     }
 }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:18,代码来源:TransportHttp.cs

示例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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:10,代码来源:URIishTests.cs

示例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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:15,代码来源:URIishTests.cs

示例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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:12,代码来源:URIishTests.cs

示例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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:13,代码来源:URIishTests.cs

示例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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:12,代码来源:URIishTests.cs

示例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));
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:12,代码来源:URIishTests.cs


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