Exemplo n.º 1
0
        private void ProcessDirs(Term term)
        {
            var dirList = Directory.GetDirectories(RootPath, "*.*", SearchOption.AllDirectories);

            foreach (var dir in dirList)
            {
                DirectoryInfo dirInfo   = new DirectoryInfo(dir);
                bool          antiMatch = AntiFileTerms.Any(t => dirInfo.FullName.Contains(t));

                if (!antiMatch)
                {
                    var dirRenamer = new DirectoryRenamer(dirInfo, IsTestMode, new List <Term> {
                        term
                    });
                    dirRenamer.Go();
                }
            }
        }
 static void Main(string[] args)
 {
     DirectoryRenamer.RenameDirectoryTree(
         @"C:\Test\FolderMatchALevel",
         name => name.Replace("MatchA", "AMatch"));
 }
 public void SetUp()
 {
     directoryRenamer = new DirectoryRenamer(testDirPath, tmpDirPath);
 }
        public void Rename_With_ValidInputs_WithoutTmpDir_Should_Return_True()
        {
            const string oldDirPath = DirNameToMove;
            const string newDirPath = "bar";

            tmpDirPath = testDirPath; // !!!!!!

            directoryRenamer = new DirectoryRenamer(testDirPath, tmpDirPath);
            bool success = directoryRenamer.Rename(oldDirPath, newDirPath);
            Assert.IsTrue(success);
        }