Skip to content

Refactor: Replace _testAssetsManager field with TestAssetsManager property in SdkTest#52757

Merged
MichaelSimons merged 2 commits intomainfrom
copilot/refactor-test-assets-manager
Feb 3, 2026
Merged

Refactor: Replace _testAssetsManager field with TestAssetsManager property in SdkTest#52757
MichaelSimons merged 2 commits intomainfrom
copilot/refactor-test-assets-manager

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Converts the protected field _testAssetsManager in SdkTest to a get-only property TestAssetsManager, following C# naming conventions and property-based encapsulation patterns.

Changes

  • SdkTest.cs: Replaced field with get-only auto-property, positioned after Log property
  • 302 test files: Updated all references from _testAssetsManager to TestAssetsManager
// Before
protected TestAssetsManager _testAssetsManager;

protected SdkTest(ITestOutputHelper log)
{
    Log = log;
    _testAssetsManager = new TestAssetsManager(log);
}

// After
protected ITestOutputHelper Log { get; }
protected TestAssetsManager TestAssetsManager { get; }

protected SdkTest(ITestOutputHelper log)
{
    Log = log;
    TestAssetsManager = new TestAssetsManager(log);
}

No behavioral changes—purely a refactoring to align with C# property conventions.

Original prompt

Change SdkTest in test/Microsoft.NET.TestFramework/SdkTest.cs to replace the protected field TestAssetsManager _testAssetsManager; with a protected get-only property named TestAssetsManager (PascalCase) placed alongside the existing Log property (i.e., following the Log property).

Requirements:

  • Implement as a get-only property: protected TestAssetsManager TestAssetsManager { get; }.
  • Initialize it in the constructor using the existing ITestOutputHelper log argument.
  • Remove the _testAssetsManager field.
  • Update all references across the dotnet/sdk repository from _testAssetsManager to TestAssetsManager.
  • Ensure the solution builds/tests compile after the rename.

Context file at commit:

Notes:

  • Repository code search results shown in chat are limited; you must search the repo for all occurrences of _testAssetsManager and update them.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: MichaelSimons <8290530+MichaelSimons@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor SdkTest to use get-only property for TestAssetsManager Refactor: Replace _testAssetsManager field with TestAssetsManager property in SdkTest Jan 30, 2026
Copilot AI requested a review from MichaelSimons January 30, 2026 22:43
@MichaelSimons MichaelSimons marked this pull request as ready for review January 30, 2026 23:41
@MichaelSimons MichaelSimons requested review from a team as code owners January 30, 2026 23:41
Copilot AI review requested due to automatic review settings January 30, 2026 23:41
@MichaelSimons MichaelSimons requested review from a team as code owners January 30, 2026 23:41
@MichaelSimons MichaelSimons requested review from a team and removed request for a team January 30, 2026 23:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@MichaelSimons MichaelSimons requested a review from a team February 2, 2026 14:47
@baronfel
Copy link
Member

baronfel commented Feb 2, 2026

/ba-g template engine search cache TLS issue

@MichaelSimons MichaelSimons merged commit dcb47af into main Feb 3, 2026
25 of 27 checks passed
@MichaelSimons MichaelSimons deleted the copilot/refactor-test-assets-manager branch February 3, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants