Esempio n. 1
0
        public void Builder_AppendsLine_BasedOnItsIdentation()
        {
            var baseIdentation = new BuilderState(new TypeInformation());

            baseIdentation.AppendLine("hello");
            var sut = baseIdentation.IncrementIdentation();

            sut.AppendLine("world");
            baseIdentation.AppendLine("!");
            Assert.Equal($"hello{Environment.NewLine}    world{Environment.NewLine}!{Environment.NewLine}", sut.Builder.ToString());
        }
Esempio n. 2
0
        public void DoubleIncrement_Adds_DoubleIdentation()
        {
            var sut = new BuilderState(new TypeInformation()).IncrementIdentation().IncrementIdentation();

            sut.AppendLine("hello");
            Assert.Equal($"        hello{Environment.NewLine}", sut.Builder.ToString());
        }
Esempio n. 3
0
        public void AppendLineWithText_Adds_Text()
        {
            var sut = new BuilderState(new TypeInformation());

            sut.AppendLine("hello");
            Assert.Equal($"hello{Environment.NewLine}", sut.Builder.ToString());
        }
Esempio n. 4
0
        public void AppendLine_Adds_EmptyLine()
        {
            var sut = new BuilderState(new TypeInformation());

            sut.AppendLine();
            Assert.Equal(Environment.NewLine, sut.Builder.ToString());
        }