From: Gennady Bystritksy Date: 2005-06-28T03:36:52+09:00 Subject: Re: unit testing singletons Joe Van Dyk wrote: > Hi, > > How can I properly unit test a singleton? I want to reinitialize it > on every test method, but since it seems to stick around in memory, I > can't seem to ever create a new singleton object. > > Thanks, > Joe > In extremely rear case when I need a singleton nowadays, I usually end up with 2 classes: one is a "normal" class that can be tested and anything and another that is the actual singleton to be used in the application that delegates all missing methods to the first one or simply inherits from it. Gennady.