Esempio n. 1
0
        public void CompileThenExists()
        {
            _engine.Compile("test-then-exists", "<body>{{body}}</body>");
            var result = _engine.Exists("test-then-exists");

            Assert.IsTrue(result);
        }
Esempio n. 2
0
        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"))
        }
Esempio n. 3
0
 public void RemoveTemplate()
 {
     _engine.Compile("test-template-to-remove", template);
     _engine.Remove("test-template-to-remove");
     Assert.IsFalse(_engine.Exists("test-template-to-remove"));
 }