Singleton Unit Testing...
Singleton Unit Testing...
Submitted by webmaster@testdriven.com (Links) on Sat, 21/08/2004 - 16:26.Jonathan de Halleux writes: "At first sight it may seem that Singleton and Unit Testing are not compatible since you cannot ensure the separation between the tests. We could solve the problem by instanciating a new 'Singleton' instance for each test and apply test on this 'local' instance. The problem is that a well implemented Singleton is sealed and it's constructor are private and thus you cannot create this instance."
