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 SettingsFileExtraEmptyLines() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\CommentSymbols-ExtraEmptyLines.txt"); Assert.AreEqual(6, fileSettings.CommentSymbols.Count()); Assert.IsNotNull(fileSettings.CommentSymbols[".master"]); Assert.AreEqual(fileSettings.CommentSymbols[".master"].Item1, "<%--"); Assert.AreEqual(fileSettings.CommentSymbols[".master"].Item2, "--%>"); }
public void SettingsFileOneWithExtraSpaces() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\CommentSymbols-1-ExtraSpaces.txt"); Assert.AreEqual(1, fileSettings.CommentSymbols.Count()); Assert.IsNotNull(fileSettings.CommentSymbols[".css"]); Assert.AreEqual("/*", fileSettings.CommentSymbols[".css"].Item1); Assert.AreEqual("*/", fileSettings.CommentSymbols[".css"].Item2); }
public void SettingsFileTwo() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\CommentSymbols-2.txt"); Assert.AreEqual(2, fileSettings.CommentSymbols.Count()); Assert.IsNotNull(fileSettings.CommentSymbols[".cs"]); Assert.AreEqual("//", fileSettings.CommentSymbols[".cs"].Item1); Assert.AreEqual(String.Empty, fileSettings.CommentSymbols[".cs"].Item2); Assert.IsNotNull(fileSettings.CommentSymbols[".js"]); Assert.AreEqual("/*", fileSettings.CommentSymbols[".js"].Item1); Assert.AreEqual("*/", fileSettings.CommentSymbols[".js"].Item2); }
public void SettingsFileTabsBetweenItems() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\CommentSymbols-Tabs.txt"); Assert.AreEqual(2, fileSettings.CommentSymbols.Count()); Assert.IsNotNull(fileSettings.CommentSymbols[".css"]); Assert.AreEqual(fileSettings.CommentSymbols[".css"].Item1, "/*"); Assert.AreEqual(fileSettings.CommentSymbols[".css"].Item2, "*/"); Assert.IsNotNull(fileSettings.CommentSymbols[".cs"]); Assert.AreEqual(fileSettings.CommentSymbols[".cs"].Item1, "//"); Assert.AreEqual(fileSettings.CommentSymbols[".cs"].Item2, String.Empty); }
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 FileSettingsIsNull() { CodeCommentSymbols fileSettings = null; FolderToWatermark folderToMark = new FolderToWatermark(Environment.CurrentDirectory + "\\..\\..\\Ressources\\FolderToWaterMark\\", fileSettings, mark); }
public void FolderDoesNotExist() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(String.Empty); FolderToWatermark folderToMark = new FolderToWatermark("Folder does not exist", fileSettings, mark); }
public void FolderIsEmpty() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(String.Empty); FolderToWatermark folderToMark = new FolderToWatermark(String.Empty, fileSettings, mark); }
public void SettingsFileInvalidFormat() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\CommentSymbols-InvalidFormat.txt"); Assert.AreEqual(0, fileSettings.CommentSymbols.Count()); }
public void SettingsFileExists() { CodeCommentSymbols fileSettings = new CodeCommentSymbols(Environment.CurrentDirectory + "\\..\\..\\Ressources\\CommentSymbols-Empty.txt"); Assert.IsTrue(fileSettings.SettingFileWasLoaded); }
public void SettingsFileDoesNotExist() { CodeCommentSymbols fileSettings = new CodeCommentSymbols("file does not exist"); Assert.IsFalse(fileSettings.SettingFileWasLoaded); }