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()); }
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); }
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); }
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()); }