Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public void FolderDoesNotExist()
 {
     CodeCommentSymbols fileSettings = new CodeCommentSymbols(String.Empty);
     FolderToWatermark  folderToMark = new FolderToWatermark("Folder does not exist", fileSettings, mark);
 }
Exemplo n.º 4
0
 public void FileSettingsIsNull()
 {
     CodeCommentSymbols fileSettings = null;
     FolderToWatermark  folderToMark = new FolderToWatermark(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\", fileSettings, mark);
 }
Exemplo n.º 5
0
 public void FolderIsEmpty()
 {
     CodeCommentSymbols fileSettings = new CodeCommentSymbols(String.Empty);
     FolderToWatermark  folderToMark = new FolderToWatermark(String.Empty, fileSettings, mark);
 }