public void DecreasingIndentation_NeverDropsBelowZero() { var sw = new StringWriter(); var iw = new IndentingTextWriter(sw, " "); iw.DecreaseIndentation(); iw.DecreaseIndentation(); Assert.AreEqual(0, iw.Indentation); }
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); }
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 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 ApplyAggregateEventCodeAuthoringVisitor(IndentingTextWriter writer, SymbolTable symbolTable, DomainCodeAuthoringSettings settings) : base(writer, symbolTable, settings) { }