Emtiaj’s Reviews > Dive Into Design Patterns > Status Update
Emtiaj
is on page 144 of 406
It may be difficult to unit test the client code of the Singleton because many test frameworks rely on inheritance when producing mock objects. Since the constructor of the singleton class is private and overriding static methods is impossible in most languages, you will need to think of a creative way to mock the singleton. Or just don’t write the tests. Or don’t use the Singleton pattern.
— Dec 19, 2020 01:54AM
1 like · Like flag

