Skip to content

Comments

Updated rule MiKo_3122 to report tests having more than 3 parameters (instead of 2 parameters)#1142

Open
RalfKoban wants to merge 57 commits intomasterfrom
MiKo_3122
Open

Updated rule MiKo_3122 to report tests having more than 3 parameters (instead of 2 parameters)#1142
RalfKoban wants to merge 57 commits intomasterfrom
MiKo_3122

Conversation

@RalfKoban
Copy link
Owner

@RalfKoban RalfKoban commented Nov 19, 2024

  • Updated rule MiKo_3122 to report test methods having more than 3 parameters instead of 2.
  • Modified the analyzer logic to check for more than 3 parameters.
  • Updated test cases to reflect the new parameter limit, including adding tests for 4 parameters.
  • Adjusted resource strings and documentation to align with the new rule specification.

Repository owner deleted a comment from QodoAI-Agent Nov 19, 2024
@RalfKoban
Copy link
Owner Author

@CodiumAI-Agent /review

@QodoAI-Agent
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Typo

The summary for MiKo_3122_Description ends with a double period (..). Remove the extra period to keep punctuation consistent.

///   Looks up a localized string similar to Test methods with more than 3 parameters are often combined tests and can be hard to read. To improve readability, split these tests into separate ones. This makes them easier to understand and maintain..
TestCase Detection

Ensure that symbol.IsTestMethod() correctly identifies methods decorated with [TestCase] so that the parameter count check applies to both [Test] and [TestCase] methods.

if (symbol.Parameters.Length > 3)
{
    var syntax = symbol.GetSyntax<MethodDeclarationSyntax>();

    yield return Issue(syntax.ParameterList);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Review in progress

Development

Successfully merging this pull request may close these issues.

2 participants