Migrate from xUnit to TUnit
ProprietaryMigrate xUnit test attributes, assertions, and lifecycle patterns to their TUnit equivalents.
OpenRewrite. Recipes. CSharp. Migration. TUnit. FromXUnit. MigrateFromXUnitmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. TUnit. FromXUnit. MigrateFromXUnitInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Migrate xUnit attributes to TUnit
- Migrate xUnit assertions to TUnit
- Add
async Taskto methods containingawait - Replace
IDisposablewith[After(Test)] - Find test constructors needing
[Before(Test)] - Find
IAsyncLifetimeneeding TUnit migration - Find
ITestOutputHelperneeding TUnit migration - Find
IClassFixture<T>needing TUnit migration - Change xUnit using directives to TUnit
- Migrate xUnit NuGet dependencies to TUnit