public void AddRootToPath_SubDirectoryOfAlreadyMappedPaths_ThrowsException() { _manager = new LibraryManager(); _manager.AddRootPath(SOME_PATH); Assert.Throws <DirectoryIsSubPathException>(() => _manager.AddRootPath(SOME_PATH_SUBPATH)); }
public void AddRootToPath_ParentDirectoryOfAlreadyMappedPaths_DeletesAllubPAthsAndAddsNewPath() { _manager = new LibraryManager(); _manager.AddRootPath(SOME_PATH_SUBPATH2); _manager.AddRootPath(SOME_PATH_SUBPATH); _manager.AddRootPath(SOME_PATH); Assert.Contains(SOME_PATH, _manager.Library.RootPath.ToList()); Assert.False(_manager.Library.RootPath.Any(x => x == SOME_PATH_SUBPATH)); Assert.False(_manager.Library.RootPath.Any(x => x == SOME_PATH_SUBPATH2)); }
public void AddRootToPath_PathWasAddedToCollectionOfRoots() { var paths = new List <string> { SOME_PATH }; _manager = new LibraryManager(paths); paths.Add(ANOTHER_PATH); _manager.AddRootPath(ANOTHER_PATH); HashSet <string> actualRoots = _manager.Library.RootPath; CollectionAssert.AreEqual(paths, actualRoots); }
public void AddRootToPath_NonExistentAth_ThrowsException() { _manager = new LibraryManager(); Assert.Throws <DirectoryNotFoundException>(() => _manager.AddRootPath(NON_EXISTENT_PATH)); }