Update testing and coverage to xUnit v3#1616
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the Humanizer project's test framework from xUnit v2 to xUnit v3, modernizing the testing infrastructure and adopting the Microsoft Testing Platform.
- Updates test framework dependencies from xUnit v2 to v3 with Microsoft Testing Platform support
- Modernizes test configuration by replacing xunit.runner.json with testconfig.json format
- Updates code coverage tooling from coverlet.collector to Microsoft.Testing.Extensions.CodeCoverage
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dotnet.config | Configures Microsoft Testing Platform as the test runner |
| src/Humanizer.Tests/xunit.runner.json | Removes legacy xUnit v2 configuration file |
| src/Humanizer.Tests/testconfig.json | Adds new xUnit v3 configuration with coverage settings |
| src/Humanizer.Tests/UseCultureAttribute.cs | Updates BeforeAfterTestAttribute methods to match xUnit v3 API |
| src/Humanizer.Tests/Humanizer.Tests.csproj | Updates project to use xUnit v3 packages and Microsoft Testing Platform |
| src/Directory.Packages.props | Updates package versions for xUnit v3 and Microsoft Testing Platform |
| src/CodeCoverage.runsettings | Removes legacy coverage configuration file |
| azure-pipelines.yml | Updates test and coverage report generation commands |
|
|
||
|
|
There was a problem hiding this comment.
Remove redundant empty lines. According to the project's code style guidelines, redundant empty lines between code blocks should be removed.
|
|
||
| <OutputType>Exe</OutputType> | ||
| <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> | ||
| <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
Remove the empty line at line 4. According to the project's code style guidelines, redundant empty lines should be removed.
| <PackageReference Include="xunit.v3" /> | ||
| <PackageReference Include="Verify.XunitV3" /> | ||
| <PackageReference Include="Verify.DiffPlex" /> | ||
| <PackageReference Include="System.ComponentModel.Annotations" Condition="'$(TargetFramework)' == 'net48' " /> | ||
| <ProjectReference Include="..\Humanizer\Humanizer.csproj" /> |
There was a problem hiding this comment.
Remove trailing whitespace after the closing tag. The project follows strict formatting guidelines.
| <PackageVersion Include="Xunit" Version="2.9.3" /> | ||
| <PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" /> | ||
| <PackageVersion Include="Verify.XunitV3" Version="31.0.1" /> | ||
| <PackageVersion Include="xunit.v3" Version="3.1.0" /> |
There was a problem hiding this comment.
Remove trailing whitespace after the closing tag. The project follows strict formatting guidelines.
| <PackageVersion Include="xunit.v3" Version="3.1.0" /> | |
| <PackageVersion Include="xunit.v3" Version="3.1.0" /> |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
b2ae18c to
664e84e
Compare
664e84e to
4ae037f
Compare
4ae037f to
5c65821
Compare
5c65821 to
6952c34
Compare
6952c34 to
47332cf
Compare
47332cf to
2234981
Compare
2234981 to
f768b60
Compare
d3fc281 to
6f43c40
Compare
6f43c40 to
aad84d1
Compare
aad84d1 to
672b97c
Compare
|
|
||
| /// <summary> | ||
| /// Apply this attribute to your test method to replace the | ||
| /// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and | ||
| /// <see cref="CultureInfo.CurrentUICulture" /> with another culture. | ||
| /// </summary> | ||
|
|
||
|
|
There was a problem hiding this comment.
Multiple consecutive empty lines should be reduced to a single empty line to follow the project's style guidelines.
672b97c to
7599d9b
Compare
7599d9b to
151d557
Compare
151d557 to
cf89104
Compare
cf89104 to
ba0e63c
Compare
| /// Replaces the culture and UI culture of the current thread with | ||
| /// <paramref name="culture" /> | ||
| /// </summary> | ||
| /// <param name="culture">The name of the culture.</param> | ||
| /// </remarks> | ||
| /// <remarks> |
There was a problem hiding this comment.
The XML documentation has redundant content. The <summary> and first <remarks> section describe the same functionality. Consider consolidating or removing the redundant <remarks> section.
ba0e63c to
38de533
Compare
38de533 to
fdb83a6
Compare
fdb83a6 to
1f867aa
Compare
| <PropertyGroup> | ||
| <TargetFrameworks>net10.0;net8.0;net48</TargetFrameworks> | ||
| <OutputType>Exe</OutputType> | ||
| <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> |
There was a problem hiding this comment.
This property is no longer required now that you use the MTP-based dotnet test.
No description provided.