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 https://github.com/microsoft/playwright-dotnet/issues/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.
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 https://github.com/microsoft/playwright-dotnet/issues/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 bedesign
.Alternative Designs
None
AB#2200925