public void CalculatePaddingForIfSpanWith4Spaces(bool designTime, bool isIndentingWithTabs, int tabSize) { RazorEngineHost host = CreateHost(designTime: designTime, isIndentingWithTabs: isIndentingWithTabs, tabSize: tabSize); Span span = GenerateSpan(@" @if (true)", SpanKind.Code, 2, "if (true)"); int padding = CodeGeneratorPaddingHelper.CalculatePadding(host, span, 1); Assert.Equal(4, padding); }
public void CalculatePaddingForEmptySpanReturnsZero() { RazorEngineHost host = CreateHost(designTime: true); Span span = new Span(new SpanBuilder()); int padding = CodeGeneratorPaddingHelper.CalculatePadding(host, span, 0); Assert.Equal(0, padding); }