Migrate GenAPI and ApiDiff test projects to MSTest.Sdk on MTP#54881
Merged
Evangelink merged 4 commits intoJun 22, 2026
Conversation
Migrates the following to MSTest.Sdk (Microsoft.Testing.Platform): - Microsoft.DotNet.GenAPI.IntegrationTests - Microsoft.DotNet.ApiDiff.Tests - Microsoft.DotNet.ApiDiff.IntegrationTests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the GenAPI and ApiDiff test projects from xUnit to MSTest.Sdk on Microsoft.Testing.Platform (MTP), aligning these projects with the repo’s ongoing xUnit → MSTest migration approach.
Changes:
- Converted GenAPI IntegrationTests and ApiDiff IntegrationTests projects to
Sdk="MSTest.Sdk"and updated tests to[TestClass]/[TestMethod]. - Converted ApiDiff unit tests from
[Fact]to[TestMethod]and ported most assertions to MSTest equivalents. - Updated test framework project references/usings for the integration test projects to use
Microsoft.NET.TestFramework.MSTest.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.DotNet.GenAPI.IntegrationTests/Tool/GenAPIToolIntegrationTests.cs | Converted tool E2E tests to MSTest attributes and removed xUnit constructor injection. |
| test/Microsoft.DotNet.GenAPI.IntegrationTests/Task/GenAPITaskIntegrationTests.cs | Converted task E2E tests to MSTest attributes and removed xUnit primary-constructor pattern. |
| test/Microsoft.DotNet.GenAPI.IntegrationTests/Microsoft.DotNet.GenAPI.IntegrationTests.csproj | Switched project to MSTest.Sdk and referenced Microsoft.NET.TestFramework.MSTest with global usings. |
| test/Microsoft.DotNet.ApiDiff.Tests/Microsoft.DotNet.ApiDiff.Tests.csproj | Switched project to MSTest.Sdk and removed legacy test framework reference. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Base.Tests.cs | Adjusted assertions for MSTest and removed an unused using. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Assembly.Tests.cs | Converted tests from xUnit [Fact] to MSTest [TestMethod]. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Attribute.Tests.cs | Converted tests to MSTest; replaced xUnit Skip with MSTest Ignore. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Class.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Constructor.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Delegate.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Destructor.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Disk.Tests.cs | Converted tests to MSTest attributes and ported several assertions. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Enum.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Event.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Field.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Interface.Tests.cs | Converted tests to MSTest attributes and replaced Skip with Ignore. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Method.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Namespace.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Operator.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Property.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Record.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Struct.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.Tests/Diff.Type.Tests.cs | Converted tests to MSTest attributes. |
| test/Microsoft.DotNet.ApiDiff.IntegrationTests/Tool/ApiDiffToolIntegrationTests.cs | Converted CLI E2E tests to MSTest attributes and removed xUnit constructor injection. |
| test/Microsoft.DotNet.ApiDiff.IntegrationTests/Microsoft.DotNet.ApiDiff.IntegrationTests.csproj | Switched project to MSTest.Sdk and referenced Microsoft.NET.TestFramework.MSTest with global usings. |
Copilot's findings
- Files reviewed: 25/25 changed files
- Comments generated: 4
SymbolFactory.cs is link-compiled into the migrated ApiDiff.Tests and GenAPI.Tests plus the still-xUnit ApiSymbolExtensions.Tests. xUnit's Assert.Empty doesn't exist under MSTest, breaking the migrated consumers (CS0117). Replace the framework-coupled Assert calls with a local AssertNoDiagnostics helper so the shared file compiles under any framework. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix 'constraing' -> 'constraint' typo in Diff.Interface.Tests Ignore message - Rename tFieldChange -> FieldChange and tFieldDelete -> FieldDelete to match the PascalCase convention used by the other tests in Diff.Field.Tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JeremyKuhne
approved these changes
Jun 22, 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 the GenAPI and ApiDiff test projects from xUnit to
MSTest.Sdkon Microsoft.Testing.Platform (MTP), following the established repo pattern.Projects:
Microsoft.DotNet.GenAPI.IntegrationTestsMicrosoft.DotNet.ApiDiff.TestsMicrosoft.DotNet.ApiDiff.IntegrationTestsNote:
Microsoft.DotNet.GenAPI.Testsis migrated separately in #54726.Part of the xUnit -> MSTest migration effort. Each project builds cleanly; tests were not run as part of this change.