Example #1
0
        public void IndentLineTest()
        {
            const int n = 3;
            const string expectedEnd = "Test";
            const char indent = '\t';

            var expected = new string( indent, n ) + expectedEnd;

            var line = new Line( n, expectedEnd );

            Assert.That( line.ToString( indent.ToString() ), Is.EqualTo( expected ) );
        }
Example #2
0
        public void AppendTextTest()
        {
            const int n = 3;
            const string expectedEnd1 = "Test";
            const string expectedEnd2 = "Simple";
            const char indent = '\t';

            var expected = new string( indent, n ) + expectedEnd1 + expectedEnd2;

            var line = new Line( n, expectedEnd1 );
            line.Append( expectedEnd2 );

            Assert.That( line.ToString( indent.ToString() ), Is.EqualTo( expected ) );
        }
Example #3
0
        private void InnerAppend( string lineSegment, bool newLine )
        {
            if (lastLine == null)
            {
                lastLine = new Line( Indent, appendString );
                this.lines.Add( lastLine );
            }
            lastLine.Append( lineSegment );

            if (newLine) lastLine = null;
        }