public void Method_with_same_type_params_invoked_with_positional_args_triggers_diagnostic() { const string testCodeSnippet = @" namespace Frobnitz { class Wombat { void Gork(string fileName, int line, int column) {} void Bork() { Gork(""Gizmo.cs"", 9000, 1); } } } "; var expectedDiagnostic = UseNamedArgumentsDiagnosticResult.Create( "Gork", new [] { new [] { "line", "column" } }, new DiagnosticResultLocation("Test0.cs", line: 9, column: 29)); UseNamedArgsCSharpAnalyzerRunner.InvokeAndVerifyDiagnostic(testCodeSnippet, expectedDiagnostic); }
/// <summary> /// No diagnostics expected to show up for <paramref name="codeSnippet" /> /// </summary> public static void EmptyDiagnosticsFor(string codeSnippet) { var emptyExpectedDiagnostics = UseNamedArgumentsDiagnosticResult.EmptyExpectedDiagnostics; UseNamedArgsCSharpAnalyzerRunner.InvokeAndVerifyDiagnostic(codeSnippet, emptyExpectedDiagnostics); }