Test.Assert() – API Extension For NUnit and MSTest

Test.Assert() is an API extension to existing unit testing frameworks, namely NUnit and MSTest. And why do we need another APIs for assertion?

The existing APIs are a bit, let’s say, computer or compiler oriented. Although English words are involved, they don’t read well. And we’re all for maximum readability.

NUnit, ported from JUnit, came with a few API, which were a super-set of what MSTest give you. Later, NUnit added the Assert.That() API, which were a step in the right direction for readability, but still looked quirky.

Test.Assert() actually goes the way we did with Isolate.Verify() APIs. It takes an expression which is (depending on how you write code) readable and extendable. It can contain compound conditions, and surpasses the existing API in both frameworks, as you can see in the example section. It’s a good example of simplicity that works.

You can download Test.Assert() from here.