Description
File: TUnit.Analyzers/PublicMethodMissingTestAttributeAnalyzer.cs (Lines 35-46)
The analyzer filters for MethodKind.Ordinary but doesn't explicitly exclude property accessor methods. If a test class has public properties, the compiler-generated get_/set_ methods could be flagged as missing a test attribute.
Impact
False positives on compiler-generated property accessors, reducing confidence in the analyzer.
Suggested Fix
Add filters to exclude MethodKind.PropertyGet, MethodKind.PropertySet, MethodKind.EventAdd, MethodKind.EventRemove, and other compiler-generated methods.
Description
File:
TUnit.Analyzers/PublicMethodMissingTestAttributeAnalyzer.cs(Lines 35-46)The analyzer filters for
MethodKind.Ordinarybut doesn't explicitly exclude property accessor methods. If a test class has public properties, the compiler-generatedget_/set_methods could be flagged as missing a test attribute.Impact
False positives on compiler-generated property accessors, reducing confidence in the analyzer.
Suggested Fix
Add filters to exclude
MethodKind.PropertyGet,MethodKind.PropertySet,MethodKind.EventAdd,MethodKind.EventRemove, and other compiler-generated methods.