How to Unit Test Classes Which Create New Objects
DZone
JANUARY 13, 2020
First of all, I will start with a disclaimer that I am a strong proponent of using the simple factory programming idiom and by extension of using the Factory Method Pattern , instead of creating objects inside classes. You may also like: Unit Testing: The Good, Bad, and Ugly.
Let's personalize your content