Skip to content

revert: migrate to TUnit - #505

Merged
vbreuss merged 1 commit into
mainfrom
topic/revert-tunit-migration
Mar 2, 2026
Merged

revert: migrate to TUnit#505
vbreuss merged 1 commit into
mainfrom
topic/revert-tunit-migration

Conversation

@vbreuss

Copy link
Copy Markdown
Member

This reverts commit 3e0dab6 from #223, because Mutation testing not yet works with MTP mode

@vbreussvbreuss self-assigned this Mar 2, 2026
CopilotAI review requested due to automatic review settings March 2, 2026 07:43
@vbreussvbreuss added the bug Something isn't working label Mar 2, 2026

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts the migration from xUnit to TUnit (done in PR #223), because mutation testing does not yet work with Microsoft Testing Platform (MTP) mode that TUnit uses.

Changes:

  • Replaces all TUnit test attributes ([Test], [Arguments], [MethodDataSource]) with xUnit equivalents ([Fact], [Theory], [InlineData], [MemberData])
  • Updates project files to swap TUnit dependencies for xUnit packages and adjusts build pipeline scripts accordingly
  • Removes the custom Record helper class and reverts Usings.cs files across all test projects

Reviewed changes

Copilot reviewed 153 out of 165 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
Tests/Directory.Build.propsSwaps TUnit engine/dependencies for xUnit, coverlet, and test SDK packages
Directory.Packages.propsReplaces TUnit and Polyfill package versions with xUnit and coverlet equivalents
Pipeline/Build.UnitTest.csUpdates test run arguments from MTP/TUnit style to xUnit/standard dotnet test style
Pipeline/Build.MutationTests.csRemoves --testrunner mtp flag, downgrades stryker, targets net8.0 instead of net10.0
Pipeline/Build.CodeCoverage.csUpdates coverage report glob to match coverlet output path
Pipeline/Build.ApiChecks.csUpdates test run arguments to xUnit/standard style
Tests/Mockolate.Tests/TestHelpers/Usings.csSwaps using TUnit for using Xunit
Tests/Mockolate.Tests/TestHelpers/Record.csRemoves TUnit-specific Record helper class
All Tests/**/Usings.csReplaces TUnit global using with Xunit
All test .cs filesReplaces [Test]/[Arguments]/[MethodDataSource] with [Fact]/[Theory]/[InlineData]/[MemberData]
Tests/Mockolate.Tests/Internals/TypeFormatterTests.csConverts MethodDataSource + tuple IEnumerable to MemberData + TheoryData<T,T>
Tests/Mockolate.Api.Tests/ApiApprovalTests.csConverts MethodDataSource + yield to MemberData + TheoryData<T>
Tests/Mockolate.Api.Tests/ApiAcceptance.csConverts [Explicit] to [Fact(Explicit = true)]
Tests/Mockolate.Api.Tests/Mockolate.Api.Tests.csprojTargets net8.0, switches to xunit.v3
Tests/Mockolate.Tests/MockDelegates/DelegateTests.csMixes aweXpect assertions with Assert.True/Assert.Equal
Tests/Mockolate.Tests/Verify/VerificationResultTests.AsyncTests.csAdjusts timing thresholds for Within_ShouldAbortAsSoonAsConditionIsSatisfied
Tests/Mockolate.Api.Tests/Helper.csRemoves unused using Assembly alias
Source/Mockolate/Mockolate.csprojUnconditionally includes IsExternalInit package reference
Tests/Mockolate.ExampleTests/Mockolate.ExampleTests.csprojAdds IsExternalInit package reference
Tests/Mockolate.Api.Tests/Expected/Mockolate_net10.0.txtRemoves [ParamCollection] attribute from API snapshot
.github/workflows/ci.ymlRemoves fail-fast: false from matrix strategy
Mockolate.sln.DotSettingsRemoves TUnit-specific ReSharper unit testing settings

Comment threadTests/Mockolate.Tests/MockDelegates/DelegateTests.cs
Comment threadTests/Mockolate.Api.Tests/ApiAcceptance.cs
@vbreuss
vbreuss merged commit c3d698c into mainMar 2, 2026
8 checks passed
@vbreuss
vbreuss deleted the topic/revert-tunit-migration branch March 2, 2026 07:45
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz (Max: 2.79GHz), 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.103
[Host] : .NET 10.0.3 (10.0.3, 10.0.326.7603), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

MethodMeanErrorStdDevGen0Gen1Allocated
Simple_Mockolate1.546 μs0.0327 μs0.0306 μs0.1640-4.02 KB
Simple_Moq132.298 μs0.8410 μs0.7455 μs0.48830.244114.56 KB
Simple_NSubstitute5.916 μs0.0746 μs0.0698 μs0.3662-9.14 KB
Simple_FakeItEasy6.095 μs0.0426 μs0.0378 μs0.32810.01538.12 KB
Simple_TUnitMocks1.980 μs0.0736 μs0.0575 μs0.26320.00766.54 KB

@github-actions

Copy link
Copy Markdown

This is addressed in release v1.5.1.

@github-actionsgithub-actionsBot added the state: released The issue is released label Mar 2, 2026
@vbreussvbreuss mentioned this pull request Apr 30, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingstate: releasedThe issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@vbreuss