// Internal for testing
 internal static DiagnosticSeverity ConvertSeverity(RazorDiagnosticSeverity severity)
 {
     return(severity switch
     {
         RazorDiagnosticSeverity.Error => DiagnosticSeverity.Error,
         _ => DiagnosticSeverity.Information,
     });
        // Internal for testing
        internal static DiagnosticSeverity ConvertSeverity(RazorDiagnosticSeverity severity)
        {
            switch (severity)
            {
            case RazorDiagnosticSeverity.Error:
                return(DiagnosticSeverity.Error);

            default:
                return(DiagnosticSeverity.Information);
            }
        }
Beispiel #3
0
    public RazorDiagnosticDescriptor(
        string id,
        Func <string> messageFormat,
        RazorDiagnosticSeverity severity)
    {
        if (string.IsNullOrEmpty(id))
        {
            throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(id));
        }

        if (messageFormat == null)
        {
            throw new ArgumentNullException(nameof(messageFormat));
        }

        Id             = id;
        _messageFormat = messageFormat;
        Severity       = severity;
    }