I have been using XUnit and the more I use it the more I like it. I used to use NUnit (infrequently and hence I don’t know if the following features are also supported) but then I noticed a movement towards using XUnit. What really made me decide to learn more about the latter came about while going through the Outside in TDD course. In the latter, the author showed how easy it was to set up and tear down a database simply by implementing events that take place before a unit test is run. From that moment, I was hooked.
Today, while working on parametised tests, I came across the following issue:
An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
and this is caused by the fact that I tried to pass a resource file in as a parameter to the attribute as follows:
[InlineData("a", "b", "c", Resources.someResource)]
I was really struggling to get round this until I found this post. I simply followed the example about PropertyData and that solved my problem.