Skip to content
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

MSTEST0006: Add code fix #3399

Closed
engyebrahim opened this issue Aug 2, 2024 · 2 comments · Fixed by #4038
Closed

MSTEST0006: Add code fix #3399

engyebrahim opened this issue Aug 2, 2024 · 2 comments · Fixed by #4038

Comments

@engyebrahim
Copy link
Member

engyebrahim commented Aug 2, 2024

AB#2200928

@Youssef1313
Copy link
Member

I don't think we can provide a good codefix here is it mostly depends on user intent. We have a test method marked with ExpectedException attribute but can't statically "guess" at which line the exception is expected. The best the codefix can do is to wrap the whole test method with Assert.ThrowsException, but it's not ideal.

@Evangelink
Copy link
Member

You are right but I was thinking to provide the following 2 codefixes:

  1. Wrap all content
  2. Wrap last statement. This is only an heuristic but this should be the last line of code actually executed in most of the "correct" scenario.

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants