Example #1
0
 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);
 }
Example #2
0
        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(); }));
            }
        }
Example #3
0
 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);
 }
Example #4
0
 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"));
 }
Example #5
0
 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);
 }
Example #6
0
 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);
 }
Example #7
0
 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);
 }