Migrate from MSTest to xUnit using a Roslyn analyzer
Both MSTest and xUnit are great test framework. If you are curious about, I've written many blog posts about them
If you want to migrate to xUnit from MSTest, I've written a Roslyn Analyzer. This analyzer reports all MSTest attributes and assertions in your code. It can also replace most of them with xUnit equivalent. Note that the goal of this analyzer is not to handle 100% of the cases, but to handle the most common ones and reduce the time to migrate.
First, add the NuGet package to your project:
Shell
dotnet add package Meziantou.MSTestToXunitAnalyzer
Then, you should see warnings in your code. You can fix them manually or use the quick fix provided by the analyzer.
Do you have a question or a suggestion about this post? Contact me!
Enjoy this blog?💖 Sponsor on GitHub