Repository navigation
Split TestHostBuilder host-mode logic into focused files - #12612
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
Result: no actionable findings.
Scope: a structural split of TestHostBuilder.Modes.cs into .InvocationLifetime.cs, .Orchestration.cs and .TestHostMode.cs, for 4 files total.
Evidence:
- I ran
git diff --color-movedwith whitespace ignored. Every code line removed fromModes.csreappears in one of the three new files. The only non-moved lines are the new file headers, usings, namespace and partial-class wrappers. - The new files carry the license header and a UTF-8 BOM, use file-scoped namespaces, and keep
internal sealed partial class TestHostBuilder. - There is no public API or
PublicAPI.*.txtimpact, and no resource, localization or CLI-option changes. - The
usingdirectives left inModes.csappear to be the ones its remaining code needs. I could not confirm this by compiling.
Not verified:
- I could not run a build here because the sandbox denied execution, so I did not confirm that the unused-using analyzers (IDE0005) are clean.
- I did not run the unit tests. They exist in the repo and should cover this refactor.
- I did not read the new files' contents beyond the diff comparison. I saw no behaviour change in the moved code, but I did not rule out subtle changes such as member accessibility or ordering by reading it line by line.
Test-value evidence: this is a behavior-preserving refactor. Executed before/after evidence is unavailable; CI green on the unchanged existing unit and acceptance tests is the expected proof.
TestHostBuilder.Modes.cshad grown to 550 lines, combining host selection, orchestration, invocation lifetime, and test-host construction. This change separates those responsibilities while preserving the existing method bodies and contracts.TestHostBuilder.Modes.csTestHostBuilder.Orchestration.csTestHostBuilder.InvocationLifetime.csTestHostBuilder.TestHostMode.cs