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 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 GetRemotePathThrowsExceptionOnNullArgument([Values(true, false)]bool withValidation) { var storage = new MetaDataStorage(this.engine, this.matcher, withValidation); Assert.Throws<ArgumentNullException>(() => storage.GetRemotePath(null)); }