Summary
Prevent testing issues (such as NRE) when user is shadowing test members.
Background and Motivation
.NET allows to do shadowing of members and MSTest will respect the behavior but this is nearly always causing issues. When shadowing a member (test, TestContext property...) from a base class, the base class is ignored (see microsoft/playwright-dotnet#2958).
Proposed Feature
Raise a diagnostic when a member is being shadowed even if the user is using the new keyword to force shadowing.
The analyzer should be enabled by default with a warning severity and its category should be design.
Alternative Designs
None
AB#2200925
Summary
Prevent testing issues (such as NRE) when user is shadowing test members.
Background and Motivation
.NET allows to do shadowing of members and MSTest will respect the behavior but this is nearly always causing issues. When shadowing a member (test, TestContext property...) from a base class, the base class is ignored (see microsoft/playwright-dotnet#2958).
Proposed Feature
Raise a diagnostic when a member is being shadowed even if the user is using the
newkeyword to force shadowing.The analyzer should be enabled by default with a
warningseverity and its category should bedesign.Alternative Designs
None
AB#2200925