Esempio n. 1
0
        public void SimpleBlockTemplateCompilesCorrectly()
        {
            var source   = FileHelper.GetTemplateSource("simple-block.html");
            var compiler = new GlobalTemplateCompiler(TemplateName, source);
            var result   = compiler.Compile().ToString();

            Assert.AreEqual(result, "function methodName(model){var t='';t+='<ul>'; for(var i = 0; i < model.users.length; i++) { t+='<li>'+ model.users[i].name ;t+='</li>'; } t+='</ul>';return t;}");
        }
Esempio n. 2
0
        public void SimpleTemplateCompilesCorrectly()
        {
            var source   = FileHelper.GetTemplateSource("simple.html");
            var compiler = new GlobalTemplateCompiler(TemplateName, source);
            var result   = compiler.Compile().ToString();

            Assert.AreEqual(result, "function methodName(model){var t='';t+='<div>'+ model.test ;t+='</div>';return t;}");
        }