public void ParagraphShouldParseCorrectly() { FileSystemCache.AddFile("templates/template/tag_templates/p.html", new MockFileData("<p>{{}}</p>")); FileSystemCache.AddFile("templates/template/site_template.html", new MockFileData("<html>{{}}</html>")); FileSystemCache.AddDirectory("output"); FileSystemCache.AddFile("input/file1.md", new MockFileData("This is some text!")); ServiceProvider.GetService <Generator>().Start(); const string expectedContent = @"<html><p>This is some text!</p></html>"; const string expectedName = "/output/file1.html"; Assert.True(this.FileExists(expectedName)); Assert.Equal(expectedContent, this.ReadFileContents(expectedName)); }
public void ShouldCopySubDirectories() { FileSystemCache.AddFile("templates/template/tag_templates/h1.html", new MockFileData("<h1>{{}}</h1>")); FileSystemCache.AddFile("templates/template/tag_templates/p.html", new MockFileData("<p>{{}}</p>")); FileSystemCache.AddFile("templates/template/site_template.html", new MockFileData("<html>{{}}</html>")); FileSystemCache.AddDirectory("output"); FileSystemCache.AddDirectory("input/Folder1"); FileSystemCache.AddDirectory("input/Folder1/SubFolder1"); FileSystemCache.AddDirectory("input/Folder1/SubFolder2"); FileSystemCache.AddDirectory("input/Folder2"); ServiceProvider.GetService <Generator>().Start(); Assert.Contains("/output/Folder1/SubFolder1", FileSystemCache.AllDirectories); Assert.Contains("/output/Folder1/SubFolder2", FileSystemCache.AllDirectories); Assert.Contains("/output/Folder2", FileSystemCache.AllDirectories); }
public void Test() { FileSystemCache.AddDirectory("input"); FileSystemCache.AddFile("input/file1.txt", new MockFileData(string.Empty)); FileSystemCache.AddFile("input/file2.txt", new MockFileData(string.Empty)); FileSystemCache.AddDirectory("input/Folder1"); FileSystemCache.AddFile("input/Folder1/file1.txt", new MockFileData(string.Empty)); FileSystemCache.AddFile("input/Folder1/file2.txt", new MockFileData(string.Empty)); FileSystemCache.AddDirectory("output"); ServiceProvider.GetService <Generator>().Start(); Assert.Contains("/output/file1.txt", FileSystemCache.AllFiles); Assert.Contains("/output/file2.txt", FileSystemCache.AllFiles); Assert.Contains("/output/Folder1/file1.txt", FileSystemCache.AllFiles); Assert.Contains("/output/Folder1/file2.txt", FileSystemCache.AllFiles); }