Hi,
Do we need to do anything special when developing singleton's (such as decorating them with a
shared resources attribute)?
This blog indicates that we don't, but my unit tests are having issues.
I'm using Rhino Mocks to partially mock out the singleton instance for some tests, and to mock out a field on the instance for other tests. When I mock the field on a real instance, I randomly receive the error "This action is invalid when the mock object is in verified state." I don't get this from other test runners, and I don't get it when I explicitly set the singleton instance in the unit test. This implies to me that the singleton is being leaked across tests somehow.
I can provide a sample solution if required.
Thanks.