public void GetRemotePath() { var matcher = new Mock <IPathMatcher>(); matcher.Setup(m => m.RemoteTargetRootPath).Returns("/"); var storage = new MetaDataStorage(this.engine, matcher.Object); var remoteFolder = new MappedObject("remoteFolder", "remoteId", MappedObjectType.Folder, null, null); storage.SaveMappedObject(remoteFolder); string remotePath = storage.GetRemotePath(remoteFolder); Assert.That(remotePath, Is.EqualTo("/remoteFolder")); }
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")); }
public void GetRemotePathThrowsExceptionOnNonExistingIdInObject() { var storage = new MetaDataStorage(this.engine, this.matcher); storage.GetRemotePath(Mock.Of <IMappedObject>()); }
public void GetRemotePathThrowsExceptionOnNullArgument() { var storage = new MetaDataStorage(this.engine, this.matcher); storage.GetRemotePath(null); }
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>())); }
public void GetRemotePathThrowsExceptionOnNullArgument([Values(true, false)] bool withValidation) { var storage = new MetaDataStorage(this.engine, this.matcher, withValidation); Assert.Throws <ArgumentNullException>(() => storage.GetRemotePath(null)); }