The .NET ecosystem for testing has been quite stable for a while now. It all began with NUnit and MSTest, and then xUnit came along and became the mos

Meet TUnit: The New, Fast, and Extensible .NET Testing Framework

submited by
Style Pass
2024-12-12 14:30:07

The .NET ecosystem for testing has been quite stable for a while now. It all began with NUnit and MSTest, and then xUnit came along and became the most popular choice for .NET developers when it became the default testing framework for .NET Core projects. Personally, I don’t really have any big complaints or gripes about these platforms. They all do what they need to do, and they do it well. However, I recently stumbled upon a new (open source) testing framework called TUnit, and I thought it was worth checking out, especially since it’s a new contender in a space that hasn’t seen much change in a while!

TUnit is a new testing framework (for .NET 8 and up) that aims to address pain points in existing testing frameworks. Furthermore, it wants to be more extensible and a whole lot faster! It’s created by Tom Hirst, and it’s still in preview at the time of writing. However, this doesn’t mean you shouldn’t follow or even try out this new framework!

Even though it has “unit” in the name, you’re not limited to unit tests. You can write integration tests, acceptance tests, and more with TUnit! Finally, it also has great documentation. In this post I want to document the process of getting started with TUnit, and show you how to write your first test with it and compare it to other platforms.

Leave a Comment