From 3701b6f066cc1735d3473fe8180bf6af552361ff Mon Sep 17 00:00:00 2001 From: Richard Murillo Date: Tue, 27 Aug 2024 11:27:10 -0700 Subject: [PATCH] Update Diagnostic to use factory method --- .../CallbackSignatureShouldMatchMockedMethodAnalyzer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Moq.Analyzers/CallbackSignatureShouldMatchMockedMethodAnalyzer.cs b/src/Moq.Analyzers/CallbackSignatureShouldMatchMockedMethodAnalyzer.cs index b269fb17..9d5cc8f0 100644 --- a/src/Moq.Analyzers/CallbackSignatureShouldMatchMockedMethodAnalyzer.cs +++ b/src/Moq.Analyzers/CallbackSignatureShouldMatchMockedMethodAnalyzer.cs @@ -58,7 +58,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context) if (mockedMethodArguments.Count != lambdaParameters.Count) { - Diagnostic diagnostic = Diagnostic.Create(Rule, callbackLambda.ParameterList.GetLocation()); + Diagnostic diagnostic = callbackLambda.ParameterList.GetLocation().CreateDiagnostic(Rule); context.ReportDiagnostic(diagnostic); } else