Announcement
iPhone DZone: Fresh Links On Your iPhone by matt at Sat Jul 05 14:09:51 EDT 2008
Reading DZone on your iPhone just got a little bit easier. Visit http://dzone.com/iphone from your iPhone to try out our beta iPhone support. You can view stories, filter by tags, and login. We'd appreciate your feedback at feedback@dzone.com.
DZone depends on you. Login and vote now.
By bloid
via googletesting.blogspot.com
Published: May 19 2008 / 10:16
It's hard to test code that uses singletons. Typically, the code you want to test is coupled strongly with the singleton instance. You can't control the creation of the singleton object because often it is created in a static initializer or static method. As a result, you also can't mock out the behavior of that Singleton instance.
Comments
Gene Gotimer replied ago:
Needs more explanation, as the comments there point out.
Voters For This Link (11)
Voters Against This Link (2)