public void Cleanup()
    {
        var diagnostics = benchmark.CreateDiagnostics(
            d => d.WithLocation(3, 8, 3, 14).WithArguments("Record"),
            d => d.WithLocation(9, 15, 9, 22).WithArguments("record")
            );

        benchmark.Inspect(diagnostics);
    }
    public void Cleanup()
    {
        var diagnostics = benchmark.CreateDiagnostics(
            (DiagnosticIds.F01001, d => d.WithLocation(12, 13, 12, 29).WithArguments("is", "overloaded", "==", "operator", "null")),
            (DiagnosticIds.F01001, d => d.WithLocation(13, 13, 13, 29).WithArguments("is not", "overloaded", "!=", "operator", "non-null")),
            (DiagnosticIds.F01002, d => d.WithLocation(15, 13, 15, 37).WithArguments("is", "==", "operator", "null")),
            (DiagnosticIds.F01002, d => d.WithLocation(16, 13, 16, 37).WithArguments("is not", "!=", "operator", "non-null"))
            );

        benchmark.Inspect(diagnostics);
    }
コード例 #3
0
    public void Cleanup()
    {
        var diagnostics = benchmark.CreateDiagnostics(
            d => d.WithLocation(14, 9, 14, 20).WithArguments("goto Label;"),
            d => d.WithLocation(23, 17, 23, 29).WithArguments("goto case 2;"),
            d => d.WithLocation(26, 17, 26, 29).WithArguments("goto case 1;"),
            d => d.WithLocation(39, 17, 39, 30).WithArguments("goto default;")
            );

        benchmark.Inspect(diagnostics);
    }