public void WriteCSharpExpression_SkipsLinePragma_WithoutSource()
    {
        // Arrange
        var codeWriter = new CodeWriter();
        var writer     = new RuntimeNodeWriter()
        {
            WriteCSharpExpressionMethod = "Test",
        };
        var context = TestCodeRenderingContext.CreateRuntime();

        var node    = new CSharpExpressionIntermediateNode();
        var builder = IntermediateNodeBuilder.Create(node);

        builder.Add(new IntermediateToken()
        {
            Content = "i++",
            Kind    = TokenKind.CSharp,
        });

        // Act
        writer.WriteCSharpExpression(context, node);

        // Assert
        var csharp = context.CodeWriter.GenerateCode();

        Assert.Equal(
            @"Test(i++);
",
            csharp,
            ignoreLineEndingDifferences: true);
    }
    public void WriteCSharpExpression_WithSource_WritesPadding()
    {
        // Arrange
        var codeWriter = new CodeWriter();
        var writer     = new RuntimeNodeWriter()
        {
            WriteCSharpExpressionMethod = "Test",
        };
        var context = TestCodeRenderingContext.CreateRuntime();

        var node = new CSharpExpressionIntermediateNode()
        {
            Source = new SourceSpan("test.cshtml", 8, 0, 8, 3, 0, 11),
        };
        var builder = IntermediateNodeBuilder.Create(node);

        builder.Add(new IntermediateToken()
        {
            Content = "i",
            Kind    = TokenKind.CSharp,
        });
        builder.Add(new MyExtensionIntermediateNode());
        builder.Add(new IntermediateToken()
        {
            Content = "++",
            Kind    = TokenKind.CSharp,
        });

        // Act
        writer.WriteCSharpExpression(context, node);

        // Assert
        var csharp = context.CodeWriter.GenerateCode();

        Assert.Equal(
            @"
#nullable restore
#line (1,9)-(1,12) 5 ""test.cshtml""
Test(iRender Children
++);

#line default
#line hidden
#nullable disable
",
            csharp,
            ignoreLineEndingDifferences: true);
    }