-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider readonly TestContext as valid #4053
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please double check if we have a test case where we would have readonly TestContext
property and no ctor accepting TestContext
parameter? I think we should still raise in this case because the property would end up not being set.
We don't have a good way to detect that at run-time. Do you think going for an analyzer would be the best approach for now? Edit: Adjusted the existing analyzer |
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @Youssef1313, a few nits but otherwise LGTM
src/Analyzers/MSTest.Analyzers.CodeFixes/TestContextShouldBeValidFixer.cs
Outdated
Show resolved
Hide resolved
Happy with the current state so I'll move the PR as-is. Thanks @Youssef1313 |
Fixes #4032