About a year ago, me and some other colleagues started to create a simple framework for verifying the outcome of unit tests in a more natural way. Martin Opdam already blogged about this in June and since then we have been adding some minor features.
A few weeks ago I discovered the much more powerful SharpTestEx and decided to drop further development on our own extensions. I do like some of SharpTestEx’s features, but I found some limitations that causes me to reconsider. Last weekend, I decided to reinstate our extensions under the name of Fluent Assertions and release them on CodePlex.
So why do I think it is better? First of all, because we only have one level of indirection (the Should() extension method), it is much easier to add you own domain-specific extensions. This is something we do often and should be very trivial.
Secondly, all our verification methods accept a phrase stating the reason of the expected outcome such as “because it is a required field” that is used to generate a clear and comprehensive error message when the verification fails. This should help you from staying out of the debugger hell when a test fails.
As I’m writing this we are already working on the next release which should be available in the next few days.