Adding test description for data-driven tests in xUnit
Often times, you find yourself in writing data-driven tests in xUnit (like Theory
tests) and you want to add a description to each test case. Let's explore how to do that.
Often times, you find yourself in writing data-driven tests in xUnit (like Theory
tests) and you want to add a description to each test case. Let's explore how to do that.
I know that there is a lot of fuse about TUnit and I am here writing about xUnit. I might cover TUnit in the future, but for now, the topic is the v3
prerelease of xUnit!
I recently discovered this small but very useful utility in xUnit: TheoryData<T>
.
In almost all of my projects, I only use xUnit, and here is a small love letter. Especially the one fact I do think makes it a good choice!