Refactor: Split TestMethodInfo.cs (1113 lines) into focused partial classes#7967
Draft
Refactor: Split TestMethodInfo.cs (1113 lines) into focused partial classes#7967
Conversation
5 tasks
Agent-Logs-Url: https://github.com/microsoft/testfx/sessions/791ae228-73c6-425b-88de-ec6be8fd209a Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor TestMethodInfo.cs into focused partial classes
Refactor: Split TestMethodInfo.cs (1113 lines) into focused partial classes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TestMethodInfo.cshad grown to 1113 lines, mixing concerns across constructor/properties, argument resolution, configuration reading, test execution, lifecycle management, and context setup — making it hard to navigate and review.Split into 6 partial class files
TestMethodInfo.csGetAllAttributes,GetAttributes<T>TestMethodInfo.Arguments.csSetArguments,ResolveArgumentsTestMethodInfo.Configuration.csGetTestTimeout,GetTestMethodAttribute,GetRetryAttribute,ThrowMultipleAttributesExceptionTestMethodInfo.Execution.csInvokeAsync,ExecuteInternalAsync,ExecuteInternalWithTimeoutAsync,GetRealException,HandleMethodExceptionTestMethodInfo.Lifecycle.csRunTestInitializeMethodAsync,RunTestCleanupMethodAsync, allInvoke*lifecycle methods,CaptureExecutionContextAfterFixtureIfNeededTestMethodInfo.Context.csSetTestContext,CreateTestClassInstanceNotes
usingdirectives it actually needs#pragma warning disable CA1852propagated to all partial class filesTestMethodInfo.Execution.csis 452 lines (above the 300-line guideline) because the execution pipeline methods are inherently larger than the issue estimated; further splitting would break logical cohesionWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
c50vsblobprodcus330.vsblob.vsassets.io/usr/bin/dotnet dotnet restore test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ conntrack --ctstate INVALID,NEW -j DROP(dns block)jd4vsblobprodcus366.vsblob.vsassets.io/usr/bin/dotnet dotnet restore test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ conntrack --ctstate INVALID,NEW -j DROP(dns block)If you need me to access, download, or install something from one of these locations, you can either: