public void GetLocalPathOfNonExistingEntryReturnsNull([Values(true, false)] bool withValidation) { var matcher = new Mock <IPathMatcher>(); matcher.Setup(m => m.LocalTargetRootPath).Returns(Path.GetTempPath()); var storage = new MetaDataStorage(this.engine, matcher.Object, withValidation); string id = "nonExistingId"; var rootFolder = new MappedObject("name", "otherId", MappedObjectType.Folder, null, null); var otherFolder = new MappedObject("name", id, MappedObjectType.Folder, "otherId", null); storage.SaveMappedObject(rootFolder); Assert.That(storage.GetLocalPath(otherFolder), Is.Null); }
public void GetLocalPath() { var matcher = new Mock <IPathMatcher>(); matcher.Setup(m => m.LocalTargetRootPath).Returns(Path.GetTempPath()); var storage = new MetaDataStorage(this.engine, matcher.Object); string id = "remoteId"; var rootFolder = new MappedObject("name", id, MappedObjectType.Folder, null, null); storage.SaveMappedObject(rootFolder); string path = storage.GetLocalPath(rootFolder); Assert.That(path, Is.EqualTo(Path.Combine(Path.GetTempPath(), "name"))); }
public void GetLocalPathThrowsExceptionOnNonExistingIdInObject() { var storage = new MetaDataStorage(this.engine, this.matcher); storage.GetLocalPath(Mock.Of <IMappedObject>()); }
public void GetLocalPathThrowsExceptionOnNullArgument() { var storage = new MetaDataStorage(this.engine, this.matcher); storage.GetLocalPath(null); }
public void GetLocalPathThrowsExceptionOnNonExistingIdInObject([Values(true, false)] bool withValidation) { var storage = new MetaDataStorage(this.engine, this.matcher, withValidation); Assert.Throws <ArgumentException>(() => storage.GetLocalPath(Mock.Of <IMappedObject>())); }
public void GetLocalPathThrowsExceptionOnNullArgument([Values(true, false)] bool withValidation) { var storage = new MetaDataStorage(this.engine, this.matcher, withValidation); Assert.Throws <ArgumentNullException>(() => storage.GetLocalPath(null)); }