Esempio n. 1
0
        public void WriteNewLineIfRepeated_RepeatedCode_AppendsNewline()
        {
            var classBuilder = new CodeDomClassBuilder();

            classBuilder.AppendCodeSnippet("for (int c = 0; c < 3; c++)", true);
            classBuilder.Append("Test");
            classBuilder.RenderEndBlock();
            string templateSource = classBuilder.Build(ClassName);
            var    result         = GenerateTemplateFromSource(templateSource);

            var writer = new StringWriter();

            result.Render(writer, HtmlVersion.XHtml);
            Assert.That(writer.ToString(), Is.EqualTo("Test\r\nTest\r\nTest"));
        }