From: Eric Hodel Date: 2004-05-08T01:25:16-07:00 Subject: Re: test unit & singleton --2HUpePOdetso3qZb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Gennady (gfb@tonesoft.com) wrote: > That's why you want to avoid singletons as much as possible when it=20 > comes to unit testing. >=20 > In cases I do need singletons, I usually end up with a regular class=20 > that can be unit tested, and a separate singleton class that simply=20 > delegates all calls to my actual class. Or something similar. You could muck with the internals of Singleton to reset its instance, or write an extension to your class for testing that 'resets' the class to its initialized state. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --2HUpePOdetso3qZb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFAnJlsMypVHHlsnwQRAqpNAKCotJw8DL8D4aTIsVLhB2OAZg5bZACgoaap dqHqLC4BrFSpSIrCpjV7MqU= =wF8g -----END PGP SIGNATURE----- --2HUpePOdetso3qZb--