Пример #1
0
        public void CanCreateLocalPathTest()
        {
            string remote  = this.remotepath + "/test";
            string wrong   = "/wrong/path/on/server/test";
            var    matcher = new PathMatcher(this.localpath, this.remotepath);

            Assert.IsTrue(matcher.CanCreateLocalPath(this.remotepath));
            Assert.IsTrue(matcher.CanCreateLocalPath(remote));
            Assert.IsFalse(matcher.CanCreateLocalPath(wrong));
            var remoteFolder = new Mock <IFolder>();

            remoteFolder.Setup(f => f.Path).Returns(this.remotepath + "/test2");
            Assert.IsTrue(matcher.CanCreateLocalPath(remoteFolder.Object));
            var wrongFolder = new Mock <IFolder>();

            wrongFolder.Setup(f => f.Path).Returns(wrong + "/test2");
            Assert.IsFalse(matcher.CanCreateLocalPath(wrongFolder.Object));
        }