Inheritance: TextWriterDecorator
示例#1
0
        public void DecreasingIndentation_NeverDropsBelowZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            iw.DecreaseIndentation();
            iw.DecreaseIndentation();
            Assert.AreEqual(0, iw.Indentation);
        }
示例#2
0
        public void IncreasingIndentation_NeverOverflows()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            iw.IncreaseIndentation(Int32.MaxValue);
            iw.IncreaseIndentation(42);

            Assert.AreEqual(Int32.MaxValue, iw.Indentation);
        }
        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);
        }
示例#4
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);
        }
        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);
        }
示例#6
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);
        }
 public ValueCodeAuthoringVisitor(IndentingTextWriter writer, SymbolTable symbolTable, DomainCodeAuthoringSettings settings) 
     : base(writer, symbolTable, settings)
 {
 }
        public void IncreasingIndentation_NeverOverflows()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            iw.IncreaseIndentation(Int32.MaxValue);
            iw.IncreaseIndentation(42);

            Assert.AreEqual(Int32.MaxValue, iw.Indentation);
        }
        public void InitialIndendation_IsZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            Assert.AreEqual(0, iw.Indentation);
        }
        public void DecreasingIndentation_ByMustBeGreaterThanZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            Assert.Throws<ArgumentOutOfRangeException>(() => iw.DecreaseIndentation(0));
            Assert.Throws<ArgumentOutOfRangeException>(() => iw.DecreaseIndentation(-42));
        }
        public void DecreasingIndentation_NeverDropsBelowZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            iw.DecreaseIndentation();
            iw.DecreaseIndentation();
            Assert.AreEqual(0, iw.Indentation);
        }
 public ApplyAggregateEventCodeAuthoringVisitor(IndentingTextWriter writer, SymbolTable symbolTable, DomainCodeAuthoringSettings settings) : base(writer, symbolTable, settings)
 {
 }