예제 #1
0
        public void AppendLineWithText_Adds_IdentationSpacesAndText()
        {
            var baseIdentation = new BuilderState(new TypeInformation());
            var sut            = baseIdentation.IncrementIdentation();

            sut.AppendLine("world");
            Assert.Equal($"    world{Environment.NewLine}", sut.Builder.ToString());
        }
예제 #2
0
        public void Increment_Increases_Identation()
        {
            var sut   = new BuilderState(new TypeInformation());
            var state = sut.IncrementIdentation();

            Assert.Equal(0, sut.Identation);
            Assert.Equal(4, state.Identation);
        }
예제 #3
0
        public void Increment_DoesNotChange_TypeInformation_Builder_ToProcessTypeSymbols()
        {
            var sut   = new BuilderState(new TypeInformation());
            var state = sut.IncrementIdentation();

            Assert.Same(sut.Builder, state.Builder);
            Assert.Same(sut.TypeInfo, state.TypeInfo);
            Assert.Same(sut.ToProcessTypeSymbols, state.ToProcessTypeSymbols);
        }
예제 #4
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());
        }