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); }
public void CreateRemotePathTest() { var matcher = new PathMatcher(this.localpath, this.remotepath); string result = matcher.CreateRemotePath(this.localpath); this.AssertPathEqual(this.remotepath, result); string subfolder = "sub"; result = matcher.CreateRemotePath(Path.Combine(this.localpath, subfolder)); Assert.AreEqual(this.remotepath + "/" + subfolder, result); subfolder = "sub/sub"; result = matcher.CreateRemotePath(Path.Combine(this.localpath, "sub", "sub")); Assert.AreEqual(this.remotepath + "/" + subfolder, result); try { matcher.CreateRemotePath(Path.Combine("wrong", "folder")); Assert.Fail(); } catch (ArgumentOutOfRangeException) { } }