Repository navigation
Migrate Microsoft.NET.Pack.Tests to MSTest.Sdk on MTP - #54848
Merged
Evangelink merged 5 commits intoJun 23, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates Microsoft.NET.Pack.Tests from xUnit to MSTest.Sdk on Microsoft.Testing.Platform, switching the test-framework reference to Microsoft.NET.TestFramework.MSTest and updating test attributes accordingly.
Changes:
- Add MSTest condition attributes (e.g.,
PlatformSpecific,RequiresMSBuildVersion) and an MSTestAspNetSdkTestbase class inMicrosoft.NET.TestFramework.MSTest. - Convert
Microsoft.NET.Pack.Testsproject file toMSTest.Sdkand referenceMicrosoft.NET.TestFramework.MSTest. - Update pack test sources from
[Fact]/[Theory]to[TestMethod]+[DataRow], and replace xUnit ctor injection with MSTest base-class usage.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.NET.TestFramework.MSTest/ConditionalTestAttributes.cs | Introduces MSTest ConditionBaseAttribute-based equivalents of common xUnit conditional test attributes. |
| test/Microsoft.NET.TestFramework.MSTest/AspNetSdkTest.cs | Adds MSTest AspNetSdkTest base class to replace xUnit ctor-injected test output patterns. |
| test/Microsoft.NET.Pack.Tests/Microsoft.NET.Pack.Tests.csproj | Switches the test project to MSTest.Sdk, references Microsoft.NET.TestFramework.MSTest, and adds needed global usings. |
| test/Microsoft.NET.Pack.Tests/SolutionPackTests.cs | Converts test class/method annotations from xUnit to MSTest. |
| test/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackASimpleLibrary.cs | Converts xUnit test + MSBuild-version gating to MSTest equivalents. |
| test/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackAProjectTool.cs | Converts xUnit tests to MSTest. |
| test/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackANetFrameworkLibrary.cs | Converts Windows-only xUnit tests to MSTest PlatformSpecific(TestPlatforms.Windows). |
| test/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackAHelloWorldProject.cs | Converts facts/theories to MSTest test methods and data rows; updates assertions to MSTest Assert.*. |
| test/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackACrossTargetedLibrary.cs | Converts xUnit MSBuild-version gating to MSTest equivalent. |
| test/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackACppCliProject.cs | Converts xUnit skip/trait usage to MSTest [Ignore] + conditional attribute usage. |
| test/Microsoft.NET.Pack.Tests/GivenThatThereAreImplicitPackageReferences.cs | Converts xUnit facts/theories to MSTest methods and data rows, including OS-gated tests. |
Copilot's findings
- Files reviewed: 11/11 changed files
- Comments generated: 3
…ia [OSCondition] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evangelink
enabled auto-merge
June 19, 2026 09:13
JeremyKuhne
approved these changes
Jun 22, 2026
JeremyKuhne
approved these changes
Jun 22, 2026
… build Microsoft.DotNet.Cli.Utils.Tests is an MSTest.Sdk project, but TransientSdkResolutionErrorDetectorTests.cs was added still using xUnit [Fact], so the test build fails with CS0246 'Fact'/'FactAttribute' on main and on every PR built against it (including this one). Add [TestClass] and convert the five [Fact] methods to [TestMethod]; MSTest.Sdk provides the MSTest namespace and FluentAssertions as implicit global usings, so no using changes are needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/ba-g #54927 |
YuliiaKovalova
approved these changes
Jun 23, 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.
Migrates
Microsoft.NET.Pack.Testsfrom xUnit to MSTest.Sdk on Microsoft.Testing.Platform (MTP), switching its test-framework reference toMicrosoft.NET.TestFramework.MSTest.Part of the SDK acceptance-test xUnit-->MSTest migration. Depends on #54845 (the
Microsoft.NET.TestFramework.MSTestfoundation) which must merge first. Compiles clean locally for all target frameworks.