public void CompileThenExists() { _engine.Compile("test-then-exists", "<body>{{body}}</body>"); var result = _engine.Exists("test-then-exists"); Assert.IsTrue(result); }
public string Render(string name, string json) { if (!_engine.Exists(name)) { var template = _provider.GetTemplate(name); if (string.IsNullOrEmpty(template)) { return(template); } EnsurePartialTemplate(template); _engine.Compile(name, template); } return(_engine.Render(name, json)); // File.ReadAllText(MapPath.Map("~/bin/_template/" + masterPath + ".handlebars")) }
public void RemoveTemplate() { _engine.Compile("test-template-to-remove", template); _engine.Remove("test-template-to-remove"); Assert.IsFalse(_engine.Exists("test-template-to-remove")); }