public void ContainsFileTypesTest() { FolderEnumerator target = new FolderEnumerator(); string folder = MAIN_PATH + "\\FolderB\\SubFolderB_A"; string[] suffixes = { "png", "jpg"}; bool expected = true; bool actual; actual = target.ContainsFileTypes(folder, suffixes); Assert.AreEqual(expected, actual); }
public void runner() { IFlickrConnect fc = new FlickrConnect(); IDriveEnumerator de = new DriveEnumerator(); IFolderEnumerator fe = new FolderEnumerator(); FlickrDriveSynchronizer syncer = new FlickrDriveSynchronizer(de, fe, fc); try { syncer.Sync(m_root_folder); } catch (Exception e) { DisplayException(e); } if (Application.Current.Dispatcher.CheckAccess()) EnableStartButton(); else { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { EnableStartButton(); })); } }
public void ContainsNotTest() { FolderEnumerator target = new FolderEnumerator(); string sub_folder = "thisisnotasubdirectory"; string folder = MAIN_PATH; bool expected = false; bool actual; actual = target.Contains(folder, sub_folder); Assert.AreEqual(expected, actual); }
public void StripParentPathTest2() { FolderEnumerator target = new FolderEnumerator(); string parent_path = "FolderA\\"; string[] path_list = test_dir_list; string[] actual; actual = target.StripParentPath(parent_path, path_list); Assert.AreEqual(actual.Length, path_list.Length); Assert.IsFalse(actual[0].StartsWith(parent_path)); Assert.IsFalse(actual[0].StartsWith("\\")); Assert.IsFalse(actual[1].StartsWith(parent_path)); Assert.IsTrue(actual[0].StartsWith("Sub")); }
public void GetSubDirectoriesTest() { FolderEnumerator target = new FolderEnumerator(); string path = MAIN_PATH; bool recursive = false; string[] actual; actual = target.GetSubDirectories(path, recursive); Assert.AreEqual(actual.Length, 2); }
public void GetFilesOfTypeTest() { FolderEnumerator target = new FolderEnumerator(); string folder = MAIN_PATH + "\\FolderB\\SubFolderB_A"; string[] suffixes = {"jpg", "png"}; string[] actual; actual = target.GetFilesOfType(folder, suffixes); Assert.AreEqual(actual.Length, 1); }
public void ContainsTest() { FolderEnumerator target = new FolderEnumerator(); string sub_folder = "SubFolderA_A"; string folder = MAIN_PATH + "\\" + "FolderA"; bool expected = true; bool actual; actual = target.Contains(folder, sub_folder); Assert.AreEqual(expected, actual); }