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

Refactor tests to simplify and inline test cases #57

Merged
merged 32 commits into from
Jun 5, 2024

Conversation

MattKotsenas
Copy link
Collaborator

@MattKotsenas MattKotsenas commented Jun 5, 2024

Mechanical refactor as a prerequisite for improving test coverage and moving from a custom test harness over to the Microsoft.CodeAnalysis.Testing harness.

Each test class used the same procedure:

  1. Split the Data\*.cs file into multiple files, one per test method
  2. Update the test harness split into multiple [Fact]s, one per Data class and accept baselines
  3. Remove unused code from the Data class and accept baselines
  4. Inline the Data class into the test harness

The CodeFix test is a bit different. Because the diagnostics and code fix should be tested together, I inlined those Data classes into a string. A future refactor to use the Microsoft.CodeAnalysis.Testing harness will further clean those up.

Added a few TODOs where test coverage appears unnecessary or missing, but avoided adding it in this change due to the difficulty of review.

@MattKotsenas MattKotsenas changed the title Refactor tests to simplify and inline test case Refactor tests to simplify and inline test cases Jun 5, 2024
Copy link
Owner

@rjmurillo rjmurillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MattKotsenas

@rjmurillo rjmurillo merged commit b33a321 into rjmurillo:master Jun 5, 2024
3 checks passed
@rjmurillo rjmurillo added this to the Future milestone Jun 5, 2024
@MattKotsenas MattKotsenas deleted the refactor/split-tests branch June 6, 2024 04:32
@rjmurillo rjmurillo modified the milestones: Future, vNext Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants