nunit.analyzers icon indicating copy to clipboard operation
nunit.analyzers copied to clipboard

Analyzer for TestCaseSource does not check Test method parameters

Open manfred-brands opened this issue 2 years ago • 0 comments

The TestCaseUsageAnalyzer warns if the test method doesn't have the same number of parameters. The TestCaseSourceUsesStringAnalyzer only test if the parameters for the test source method match.

Either create a new or add to the existing TestCaseSourceUsesStringAnalyzer code to check test parameters.

private static readonly IEnumerable<string> NUnitNameSpaces = new[] { ".NUnit", ".NUnitExtensions" };

[TestCaseSource(nameof(NUnitNameSpaces))]
public void IsNUnit()
{
}

This should raise an issue that the test method doesn't expect parameters.

manfred-brands avatar Apr 04 '22 09:04 manfred-brands