Learn the new NUnit 2.4 Constraint-Based Assert Model (blog.troyd.net)

submitted by powerrushpowerrush(3873) 4 years, 5 months ago

Instead of using a different Assert method for each different type of assertion (e.g.: Assert.AreEqual() for equality comparison, or Assert.IsTrue() for boolean evaluation), the new Constraint-Based Assert Model introduced in NUnit 2.4 utilizes only one Assert method named Assert.That().

2 comments |category: |Views: 68

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by .NetKicks.NetKicks(1304) 4 years, 4 months ago 0

Nice article, I wasn't aware of this but like those fluent interfaces and the way the code looks like when they are used.

Reply

posted by powerrushpowerrush(3873) 4 years, 4 months ago 0

Thanks! I like the way they architected the "Is" vs "Is.Not" in the syntax helpers.

FWIW, in looking at their source code, they utilize an internal Stack to implement operators such as "No" and "All" -- in the ConstraintBuilder class).

Reply

information Login or create an account to comment on this story