GetRelativeLocalPath() public méthode

Gets the relative local path.
public GetRelativeLocalPath ( string localPath ) : string
localPath string Local path.
Résultat string
        public void GetRelativePathDoesNotStartWithSlash()
        {
            this.localpath = this.localpath.EndsWith(Path.DirectorySeparatorChar.ToString()) ? this.localpath.Substring(0, this.localpath.Length - 1) : this.localpath;
            var matcher = new PathMatcher(this.localpath, "/");
            string folderName = "new";

            Assert.That(matcher.GetRelativeLocalPath(Path.Combine(this.localpath, folderName)).StartsWith(Path.DirectorySeparatorChar.ToString()), Is.False);
        }
        public void GetRootFolderRelativePathWithoutTrailingDenominator()
        {
            var matcher = new PathMatcher(Path.GetTempPath(), "/tmp");

            Assert.That(matcher.GetRelativeLocalPath(Path.GetTempPath().TrimEnd(Path.DirectorySeparatorChar)), Is.EqualTo("."));
        }
        public void GetRelativePath()
        {
            var matcher = new PathMatcher(this.localpath, this.remotepath);
            string folderName = "new";
            string newLocalPath = Path.Combine(this.localpath, folderName);

            Assert.That(matcher.GetRelativeLocalPath(newLocalPath), Is.EqualTo(folderName));
        }