예제 #1
0
파일: URIishTest.cs 프로젝트: nnieslan/ngit
 public virtual void TestFileProtocol()
 {
     // as defined by git docu
     URIish u = new URIish("file:///a/b.txt");
     NUnit.Framework.Assert.AreEqual("file", u.GetScheme());
     NUnit.Framework.Assert.IsFalse(u.IsRemote());
     NUnit.Framework.Assert.IsNull(u.GetHost());
     NUnit.Framework.Assert.IsNull(u.GetPass());
     NUnit.Framework.Assert.AreEqual("/a/b.txt", u.GetPath());
     NUnit.Framework.Assert.AreEqual(-1, u.GetPort());
     NUnit.Framework.Assert.IsNull(u.GetUser());
     NUnit.Framework.Assert.AreEqual("b.txt", u.GetHumanishName());
     FilePath tmp = FilePath.CreateTempFile("jgitUnitTest", ".tmp");
     u = new URIish(tmp.ToURI().ToString());
     NUnit.Framework.Assert.AreEqual("file", u.GetScheme());
     NUnit.Framework.Assert.IsFalse(u.IsRemote());
     NUnit.Framework.Assert.IsNull(u.GetHost());
     NUnit.Framework.Assert.IsNull(u.GetPass());
     NUnit.Framework.Assert.IsTrue(u.GetPath().Contains("jgitUnitTest"));
     NUnit.Framework.Assert.AreEqual(-1, u.GetPort());
     NUnit.Framework.Assert.IsNull(u.GetUser());
     NUnit.Framework.Assert.IsTrue(u.GetHumanishName().StartsWith("jgitUnitTest"));
     u = new URIish("file:/a/b.txt");
     NUnit.Framework.Assert.AreEqual("file", u.GetScheme());
     NUnit.Framework.Assert.IsFalse(u.IsRemote());
     NUnit.Framework.Assert.IsNull(u.GetHost());
     NUnit.Framework.Assert.IsNull(u.GetPass());
     NUnit.Framework.Assert.AreEqual("/a/b.txt", u.GetPath());
     NUnit.Framework.Assert.AreEqual(-1, u.GetPort());
     NUnit.Framework.Assert.IsNull(u.GetUser());
     NUnit.Framework.Assert.AreEqual("b.txt", u.GetHumanishName());
 }
예제 #2
0
파일: URIishTest.cs 프로젝트: ashmind/ngit
        public virtual void TestFileProtocol()
        {
            // as defined by git docu
            URIish u = new URIish("file:///a/b.txt");

            NUnit.Framework.Assert.AreEqual("file", u.GetScheme());
            NUnit.Framework.Assert.IsFalse(u.IsRemote());
            NUnit.Framework.Assert.IsNull(u.GetHost());
            NUnit.Framework.Assert.IsNull(u.GetPass());
            NUnit.Framework.Assert.AreEqual("/a/b.txt", u.GetPath());
            NUnit.Framework.Assert.AreEqual(-1, u.GetPort());
            NUnit.Framework.Assert.IsNull(u.GetUser());
            NUnit.Framework.Assert.AreEqual("b.txt", u.GetHumanishName());
            FilePath tmp = FilePath.CreateTempFile("jgitUnitTest", ".tmp");

            u = new URIish(tmp.ToURI().ToString());
            NUnit.Framework.Assert.AreEqual("file", u.GetScheme());
            NUnit.Framework.Assert.IsFalse(u.IsRemote());
            NUnit.Framework.Assert.IsNull(u.GetHost());
            NUnit.Framework.Assert.IsNull(u.GetPass());
            NUnit.Framework.Assert.IsTrue(u.GetPath().Contains("jgitUnitTest"));
            NUnit.Framework.Assert.AreEqual(-1, u.GetPort());
            NUnit.Framework.Assert.IsNull(u.GetUser());
            NUnit.Framework.Assert.IsTrue(u.GetHumanishName().StartsWith("jgitUnitTest"));
            u = new URIish("file:/a/b.txt");
            NUnit.Framework.Assert.AreEqual("file", u.GetScheme());
            NUnit.Framework.Assert.IsFalse(u.IsRemote());
            NUnit.Framework.Assert.IsNull(u.GetHost());
            NUnit.Framework.Assert.IsNull(u.GetPass());
            NUnit.Framework.Assert.AreEqual("/a/b.txt", u.GetPath());
            NUnit.Framework.Assert.AreEqual(-1, u.GetPort());
            NUnit.Framework.Assert.IsNull(u.GetUser());
            NUnit.Framework.Assert.AreEqual("b.txt", u.GetHumanishName());
        }