Thursday, May 31, 2012
In Doing Your First Mock, Mehfuz Hossain explained why you should use mocking to improve your unit tests and then used a real world example to demonstrate this technique. In this post, I will take you down a different path using other forms of stand-ins.
I will cover three types of objects used to improve unit testing:
These objects will be demonstrated using a SecurityHandler class which has been designed to allow injection of an interface in the constructor.
_service = service;