Replace [ClassData] with [MethodDataSource]

Proprietary

Replace the xUnit [ClassData(typeof(T))] attribute with TUnit's [MethodDataSource(typeof(T), nameof(T.Rows))], and give the data class T a static Rows() method that returns a new instance of it.

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

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.