Thomas Levesque 11/2/2014

Easy unit testing of null argument validation

Read Original

This article introduces a helper method that automates testing for ArgumentNullException in unit tests. It explains how to test each parameter of a method for null validation in a single test, reducing boilerplate code. The post includes a C# code example using NUnit and Expression trees to dynamically invoke methods with null arguments.

Easy unit testing of null argument validation

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week