Refactoring: parameterize constructor

In legacy code you may find classes with constructor where some objects are created and initialized. These classes are not easily testable because they depend on other classes and therefore when you unit test these classes they may also throw exceptions of classes they depend on. In these cases we can use parameterize constructor refactoring.

 

NB! This blog is moved to gunnarpeipman.com

Click here to go to article

2 Comments

Comments have been disabled for this content.