Reflection

Unit testing null parameter checks

We use constructor dependency injection throughout our application. Most service classes have constructors, which accept all dependencies in form of interfaces. We also use TDD, which means we must write unit tests for every aspect of our code. So I want to discuss one specific aspect: guarding the constructor parameters from null values and testing this guard.

Read more...