Migrate from xUnit to TUnit

Proprietary

Migrate xUnit test attributes, assertions, and lifecycle patterns to their TUnit equivalents.

OpenRewrite.Recipes.CSharp.Migration.TUnit.FromXUnit.MigrateFromXUnit
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.TUnit.FromXUnit.MigrateFromXUnit

Install 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.

  1. Migrate xUnit attributes to TUnit
  2. Migrate xUnit assertions to TUnit
  3. Add async Task to methods containing await
  4. Replace IDisposable with [After(Test)]
  5. Find test constructors needing [Before(Test)]
  6. Find IAsyncLifetime needing TUnit migration
  7. Find ITestOutputHelper needing TUnit migration
  8. Find IClassFixture<T> needing TUnit migration
  9. Change xUnit using directives to TUnit
  10. Migrate xUnit NuGet dependencies to TUnit