public void SafeToString_WithNullObject() { Person person = new Person { }; ExpressTemplateManager <StandardLibrary> expressTemplateManager = new ExpressTemplateManager <StandardLibrary>(new NullLogger <ExpressTemplateManager <StandardLibrary> >(), null, Factory.CreateStatementGenerator()); var context = expressTemplateManager.GetExpressContext <Person>("{{ company }}"); var renderResult = expressTemplateManager.Render(context, person); renderResult.ShouldBe(string.Empty); }
public RenderSimpleTemplate() { expressTemplateManager = new ExpressTemplateManager <StandardLibrary>(new NullLogger <ExpressTemplateManager <StandardLibrary> >(), new StandardLibrary(), new StatementGenerator(new NullLogger <StatementGenerator>())); scribanTemplate = Template.Parse("Hello {{name}}!"); _razorTemplate = RazorBuilder.Compile(@"Hello @Model.Name!"); }