CanCreateRemotePath() public method

Determines whether this instance can create remote path for specified localFile.
public CanCreateRemotePath ( DirectoryInfo localDirectory ) : bool
localDirectory System.IO.DirectoryInfo Local directory.
return bool
Ejemplo n.º 1
0
        public void RootFolderMatchesItselfWithoutTrailingDenominator()
        {
            var matcher = new PathMatcher(Path.GetTempPath().TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar.ToString(), "/");

            Assert.That(matcher.CanCreateRemotePath(Path.GetTempPath().TrimEnd(Path.DirectorySeparatorChar)), Is.True);
        }
Ejemplo n.º 2
0
 public void CanCreateRemotePathTest()
 {
     string local = Path.Combine(this.localpath, "test");
     string wrong = Path.Combine("wrong", "path", "on", "client", "test");
     var matcher = new PathMatcher(this.localpath, this.remotepath);
     Assert.IsTrue(matcher.CanCreateRemotePath(this.localpath));
     Assert.IsTrue(matcher.CanCreateRemotePath(local));
     Assert.IsFalse(matcher.CanCreateRemotePath(wrong));
     var localFolder = new DirectoryInfo(Path.Combine(this.localpath, "test2"));
     Assert.IsTrue(matcher.CanCreateRemotePath(localFolder));
     var wrongFolder = new DirectoryInfo(wrong);
     Assert.IsFalse(matcher.CanCreateRemotePath(wrongFolder));
 }