Пример #1
0
 public void WriteTo_with_content_should_output_expected_value(object content, string expectedOutput)
 {
     using (var wr = new StringWriter())
     {
         var template = new TestFixture(f => f.WriteTo(wr, content));
         template.Render(wr, new PageContext());
         Assert.That(wr.ToString(), Is.EqualTo(expectedOutput));
     }
 }
Пример #2
0
 public void WriteTo_with_null_LazyHtmlString_should_output_nothing()
 {
     using (var wr = new StringWriter())
     {
         var template = new TestFixture(f => f.WriteTo(wr, null));
         template.Render(wr, new PageContext());
         Assert.That(wr.ToString(), Is.EqualTo(""));
     }
 }
Пример #3
0
        public void Write_with_LazyHtmlString_should_output_expected_value(string content, string expectedOutput)
        {
            var template = new TestFixture(f => f.Write(new LazyHtmlString(wr => wr.Write(content))));

            using (var wr = new StringWriter())
            {
                template.Render(wr, new PageContext());
                Assert.That(wr.ToString(), Is.EqualTo(expectedOutput));
            }
        }