public TemplateRenderContext(string layoutPath, string mainTemplate) { Parser = new HamlTreeParser(new HamlFileLexer()); TemplateDirectory = new DirectoryInfo(mainTemplate).Parent; LayoutRoot = Parser.ParseViewSource(new FileViewSource(new FileInfo(layoutPath))); MainTemplate = Parser.ParseViewSource(new FileViewSource(new FileInfo(mainTemplate))); }
public void Walk_SingleLineFile_CallsClassBuilderBuild() { // Arrange const string className = "ClassName"; Type baseType = typeof(Template); var parser = new HamlTreeParser(new HamlFileLexer()); var document = parser.ParseDocumentSource("Simple content", ""); var imports = new List <string>(); // Act var builder = new Mock <ITemplateClassBuilder>(); new HamlDocumentWalker(builder.Object).Walk(document, className, baseType, imports); // Assert builder.Verify(x => x.Build(className, baseType, imports)); }
public void Setup() { _parser = new HamlTreeParser(new HamlFileLexer()); }