CreateLocalPath() публичный Метод

Creates the corresponding local path.
public CreateLocalPath ( IDocument remoteDocument ) : string
remoteDocument IDocument Remote document.
Результат string
Пример #1
0
        public void CrossPathCreatingTest()
        {
            var matcher = new PathMatcher(this.localpath, this.remotepath);
            string result = matcher.CreateRemotePath(this.localpath);
            this.AssertPathEqual(this.remotepath, result);
            result = matcher.CreateLocalPath(result);
            this.AssertPathEqual(this.localpath, result);

            result = matcher.CreateRemotePath(Path.Combine(this.localpath, "sub"));
            result = matcher.CreateLocalPath(result);
            this.AssertPathEqual(Path.Combine(this.localpath, "sub"), result);

            result = matcher.CreateLocalPath(this.remotepath + "/sub");
            result = matcher.CreateRemotePath(result);
            this.AssertPathEqual(this.remotepath + "/sub", result);
        }
Пример #2
0
 public void CreateLocalPathTest()
 {
     var matcher = new PathMatcher(this.localpath, this.remotepath);
     string result = matcher.CreateLocalPath(this.remotepath);
     Assert.AreEqual(this.localpath, result);
     string subfolder = "sub";
     result = matcher.CreateLocalPath(this.remotepath + "/" + subfolder);
     Assert.AreEqual(Path.Combine(this.localpath, subfolder), result);
     subfolder = "sub/sub";
     result = matcher.CreateLocalPath(this.remotepath + "/" + subfolder);
     Assert.AreEqual(Path.Combine(this.localpath, "sub", "sub"), result);
     try 
     {
         matcher.CreateLocalPath("wrong folder");
         Assert.Fail();
     }
     catch (ArgumentOutOfRangeException)
     {
     }
 }