Write() public method

public Write ( Char value ) : void
value Char
return void
コード例 #1
0
        public void Write_WithNoIndentation()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            iw.Write("Hello\r\nWorld");

            String result = sw.GetStringBuilder().ToString();

            Assert.AreEqual("Hello\r\nWorld", result);
        }
コード例 #2
0
        public void Write_WithIndentationTokenContainingNewLine_DoesNotRecurse()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "\r\n  ");
            iw.IncreaseIndentation(1);

            iw.Write("Hello\r\nWorld");

            String result = sw.GetStringBuilder().ToString();

            Assert.AreEqual("\r\n  Hello\r\n\r\n  World", result);
        }