public void It_asks_the_RenderContext_to_include_a_named_template()
        {
            var a = new TemplateInclude("a");
            var template = new Template();
            template.Load(new Part[] { new LiteralText("b") });
            var writer = new StringWriter();
            var context = new RenderContext(new Template(), null, writer, name => template, Options.Defaults());

            a.Render(context);

            Assert.AreEqual("b", writer.GetStringBuilder().ToString());
        }
예제 #2
0
        public void It_asks_the_RenderContext_to_include_a_named_template()
        {
            var a        = new TemplateInclude("a");
            var template = new Template();

            template.Load(new Part[] { new LiteralText("b") });
            var writer  = new StringWriter();
            var context = new RenderContext(new Template(), null, writer, name => template, Options.Defaults());

            a.Render(context);

            Assert.AreEqual("b", writer.GetStringBuilder().ToString());
        }
예제 #3
0
        public void It_has_a_useful_ToString_method()
        {
            var a = new TemplateInclude("a");

            Assert.AreEqual("TemplateInclude(\"a\")", a.ToString());
        }
예제 #4
0
 public void Visit(TemplateInclude include)
 {
     parts.Add(context.Include(include.Name, include.Indent));
 }
        public void It_has_a_useful_ToString_method()
        {
            var a = new TemplateInclude("a");

            Assert.AreEqual("TemplateInclude(\"a\")", a.ToString());
        }
예제 #6
0
 public void Visit(TemplateInclude include)
 {
     parts.Add(context.Include(include.Name));
 }
예제 #7
0
 public void It_trims_spaces()
 {
     var a = new TemplateInclude(" a ");
     Assert.AreEqual(a.Name, "a");
 }
예제 #8
0
        public void It_trims_spaces()
        {
            var a = new TemplateInclude(" a ");

            Assert.AreEqual(a.Name, "a");
        }