Repository navigation
test: migrate the tests from xUnit to TUnit - #187
Merged
Merged
Conversation
Aligns aweXpect.Mockolate with aweXpect and Testably.Abstractions, which run their tests on TUnit and the Microsoft.Testing.Platform, so all test projects use one framework instead of xUnit v2 on .NET and xUnit v3 on net48. ## Changes - **TUnit for all tests**: `aweXpect.Mockolate.Tests` and `aweXpect.Mockolate.Api.Tests` run on TUnit in source generation mode and share `Tests/Directory.Build.props`. xUnit, coverlet and `Microsoft.NET.Test.Sdk` are removed, and the Dependabot group for xUnit now groups the TUnit packages. - **Failure types**: without TUnit's assertions, a failed expectation throws `aweXpect.FailException` and a canceled verification TUnit's `InconclusiveTestException`, so the tests pin these types instead of `XunitException` and `InconclusiveException`. - **Explicit API acceptance**: `AcceptApiChanges` stays `[Explicit]`, so neither a normal run nor CI executes it. It runs on purpose with `dotnet test --project Tests/aweXpect.Mockolate.Api.Tests --treenode-filter "/*/*/ApiApprovalTests/AcceptApiChanges"` (documented in CONTRIBUTING.md). - **`global.json` opts into the Microsoft.Testing.Platform**, so `dotnet test` runs the whole solution. - **Pipeline**: `UnitTests` and `ApiChecks` start each project and target framework with `dotnet run` and write `TestResults/<project>_<tfm>.trx`, plus `.cobertura.xml` for the unit tests, which `CodeCoverage` merges for Sonar. Stryker runs with `--test-runner mtp` on the unit and API tests. The unused `xunit.runner.console` download is removed. - **Docs**: CONTRIBUTING.md and the agent docs describe how to run and filter the tests, and the outdated names of the mutation targets and of the coverage report format are corrected. ## Verification - Test counts are unchanged: 296 on net8.0 and net10.0, 241 on net48, and 3 API tests, with the same tests per method; `dotnet test` on the solution runs 836 tests and skips the explicit one. Five repeated runs on every target framework passed. - `./build.ps1 CodeCoverage ApiChecks` writes the TRX and Cobertura files of every target framework and the SonarQube coverage report. - A temporary public API change fails all 3 API tests, and running `AcceptApiChanges` on purpose accepts it. - Stryker 5.0.0 on the whole library: the same 13 survived and 7 uncovered mutants as on main (score 93.87 % on both). 13 of the 14 mutants that timed out on main are now killed.
vbreuss
enabled auto-merge (squash)
October 18, 2026 14:51
|
Test Results 8 files ±0 8 suites ±0 1m 8s ⏱️ -1s Results for commit 1097f0e. ± Comparison against base commit c342e9e. This pull request removes 163 and adds 162 tests. Note that renamed tests count towards both. |
🚀 Benchmark ResultsDetails
|
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.



Aligns aweXpect.Mockolate with aweXpect and Testably.Abstractions, which run their tests on TUnit and the Microsoft.Testing.Platform, so all test projects use one framework instead of xUnit v2 on .NET and xUnit v3 on net48.
Changes
aweXpect.Mockolate.TestsandaweXpect.Mockolate.Api.Testsrun on TUnit in source generation mode and shareTests/Directory.Build.props. xUnit, coverlet andMicrosoft.NET.Test.Sdkare removed, and the Dependabot group for xUnit now groups the TUnit packages.aweXpect.FailExceptionand a canceled verification TUnit'sInconclusiveTestException, so the tests pin these types instead ofXunitExceptionandInconclusiveException.AcceptApiChangesstays[Explicit], so neither a normal run nor CI executes it. It runs on purpose withdotnet test --project Tests/aweXpect.Mockolate.Api.Tests --treenode-filter "/*/*/ApiApprovalTests/AcceptApiChanges"(documented in CONTRIBUTING.md).global.jsonopts into the Microsoft.Testing.Platform, sodotnet testruns the whole solution.UnitTestsandApiChecksstart each project and target framework withdotnet runand writeTestResults/<project>_<tfm>.trx, plus.cobertura.xmlfor the unit tests, whichCodeCoveragemerges for Sonar. Stryker runs with--test-runner mtpon the unit and API tests. The unusedxunit.runner.consoledownload is removed.Verification
dotnet teston the solution runs 836 tests and skips the explicit one. Five repeated runs on every target framework passed../build.ps1 CodeCoverage ApiCheckswrites the TRX and Cobertura files of every target framework and the SonarQube coverage report.AcceptApiChangeson purpose accepts it.