示例#1
0
        public void SomeFilesInFolder()
        {
            CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\CommentSymbols.txt");
            FolderToWatermark  folderToMark = new FolderToWatermark(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\SomeFilesToRead", fileSettings, mark);

            Assert.AreEqual(3, folderToMark.FilesToProcessCount);
            Assert.AreEqual(0, folderToMark.FilesProcessedCount);
        }
示例#2
0
        public void WatermarkValidFiles()
        {
            // Copy non watermarked files over
            foreach (var file in Directory.GetFiles(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\SomeFilesToRead"))
            {
                File.Copy(file, Path.Combine(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\SomeFilesToWatermark", Path.GetFileName(file)), true);
            }

            CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\CommentSymbols.txt");
            FolderToWatermark  folderToMark = new FolderToWatermark(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\SomeFilesToWatermark", fileSettings, mark);

            Assert.AreEqual(3, folderToMark.FilesToProcessCount);
            Assert.AreEqual(0, folderToMark.FilesProcessedCount);

            folderToMark.WaterMarkFiles();

            //Assert.AreEqual(0, folderToMark.FilesToProcessCount);
            //Assert.AreEqual(3, folderToMark.FilesProcessedCount);
            //Assert.AreNotEqual(0, folderToMark.ThreadsUsedToProcessFiles);

            // Delete watermarked files
            //foreach (var file in Directory.GetFiles(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\SomeFilesToWatermark"))
            //    File.Delete(file);
        }
示例#3
0
 public void FolderDoesNotExist()
 {
     CodeCommentSymbols fileSettings = new CodeCommentSymbols(String.Empty);
     FolderToWatermark  folderToMark = new FolderToWatermark("Folder does not exist", fileSettings, mark);
 }
示例#4
0
 public void FileSettingsIsNull()
 {
     CodeCommentSymbols fileSettings = null;
     FolderToWatermark  folderToMark = new FolderToWatermark(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\", fileSettings, mark);
 }
示例#5
0
 public void FolderIsEmpty()
 {
     CodeCommentSymbols fileSettings = new CodeCommentSymbols(String.Empty);
     FolderToWatermark  folderToMark = new FolderToWatermark(String.Empty, fileSettings, mark);
 }