예제 #1
0
        private void CloneSubFolders(DirectoryInfo sourceFolderPath, DirectoryInfo sourceRootPath, string sourceNamespace, string targetPath, string targetNamespace)
        {
            foreach (var directory in Directory.GetDirectories(sourceFolderPath.ToString()))
            {
                CurrentPath = directory;
                var folderInfo = new DirectoryInfo(directory);
                var folderName = folderInfo.Name;
                if (cloningBehavior.ShouldExcludeFolder(folderName))
                {
                    continue;
                }

                var adjustedTargetPath = GetAdjustedTargetPath(directory, sourceRootPath, sourceNamespace, targetNamespace);
                var targetFolderPath   = Path.Combine(targetPath, adjustedTargetPath);

                if (!Directory.Exists(targetFolderPath))
                {
                    Directory.CreateDirectory(targetFolderPath);
                }

                CloneSubFolders(folderInfo, sourceRootPath, sourceNamespace, targetPath, targetNamespace);
                CloneFolderFiles(folderInfo, sourceRootPath, sourceNamespace, targetPath, targetNamespace);
            }
        }
 public void ShouldExcludeFolderPath_ShouldReturnFalseForNoMatchInExcludeCollection()
 {
     Assert.That(behavior.ShouldExcludeFolder("C:\\foo\\bar\\bin"), Is.False);
 }