GetRemotePath() public method

Gets the remote path.
public GetRemotePath ( IMappedObject obj ) : string
obj IMappedObject /// The MappedObject instance. ///
return string
Ejemplo n.º 1
0
 public void GetRemotePathThrowsExceptionOnNonExistingIdInObject([Values(true, false)]bool withValidation) {
     var storage = new MetaDataStorage(this.engine, this.matcher, withValidation);
     Assert.Throws<ArgumentException>(() => storage.GetRemotePath(Mock.Of<IMappedObject>()));
 }
Ejemplo n.º 2
0
        public void GetRemotePathWithCorrectSlashes([Values(true, false)]bool withValidation) {
            var matcher = new Mock<IPathMatcher>();
            matcher.Setup(m => m.RemoteTargetRootPath).Returns("/");
            var storage = new MetaDataStorage(this.engine, matcher.Object, withValidation);
            var remoteRootFolder = new MappedObject("/", "rootId", MappedObjectType.Folder, null, null);
            var remoteFolder = new MappedObject("remoteFolder", "remoteId", MappedObjectType.Folder, "rootId", null);
            storage.SaveMappedObject(remoteRootFolder);
            storage.SaveMappedObject(remoteFolder);

            string remotePath = storage.GetRemotePath(remoteFolder);

            Assert.That(remotePath, Is.EqualTo("/remoteFolder"));
        }
Ejemplo n.º 3
0
 public void GetRemotePathThrowsExceptionOnNullArgument([Values(true, false)]bool withValidation) {
     var storage = new MetaDataStorage(this.engine, this.matcher, withValidation);
     Assert.Throws<ArgumentNullException>(() => storage.GetRemotePath(null));
 }