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