You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening our test project with .NET 9, several warnings appear saying that test classes need to be internal, instead of public. We use XUnit where this is not the case. Using xunit.analyzers we are able to suppress the warnings for the testclasses.
In the test project there are other classes that could be made internal, and when we use the code fix "Make the public type internal" on the whole project or solutions all types are marked as internal, even the test classes that no longer showed the warning.
Steps To Reproduce
Create a test project with xunit and xunit.analyzers
Add a test in a public class
Add a helper class and make it public
Build the project and notice that the helper class gets the warning
Run "Make the public type internal" code fix on the whole project
Expected behavior
The test classes that have CA1515 suppressed should not be fixed by the code fix
Actual behavior
The test classes that have CA1515 suppressed are 'fixed' by the code fix, but will now throw an error from xunit saying that test classes should be public.
Analyzer
Diagnostic ID: CA1515:
Consider making public types internal
Analyzer source
SDK: Built-in CA analyzers in .NET 9 SDK or later
Version: SDK 9.0.102
Describe the bug
When opening our test project with .NET 9, several warnings appear saying that test classes need to be internal, instead of public. We use XUnit where this is not the case. Using xunit.analyzers we are able to suppress the warnings for the testclasses.
In the test project there are other classes that could be made internal, and when we use the code fix "Make the public type internal" on the whole project or solutions all types are marked as internal, even the test classes that no longer showed the warning.
Steps To Reproduce
Expected behavior
The test classes that have CA1515 suppressed should not be fixed by the code fix
Actual behavior
The test classes that have CA1515 suppressed are 'fixed' by the code fix, but will now throw an error from xunit saying that test classes should be public.
Additional context
Additional libraries used:
Related to #7192
The text was updated successfully, but these errors were encountered: