I'm not sure if I understand your entire problem, but I bet the key to solving it is isolation. Try isolating the thing you want to actually test from the singleton and see if that helps.
Alternatively, bring this to the #altnetseattle meeting tomorrow and I'm sure there will people that can help you. On Fri, Sep 17, 2010 at 14:19, sridhar visvanath <sridharvis...@gmail.com>wrote: > CacheMap (a singleton) --> Calls Repository to load a map and caches it > Hence I need the cache to be singleton > > The cache map exposes three operations A, B and C as methods. > > I want to write unit tests for the operations A, B and C > > CacheMap : ICacheMap > > If it is not a singleton, I would make repository call > > Results CallRepository() as protected virtual and override in a > MockCacheMap. > > However, CacheMap is a singleton. > > How do I unit it. Note: I have not locked at any Mock libraries. I am > trying to devise some simple mechanisms. > Am I streching it too much ? > > > -- > Thanks > Sridhar > ============================== > The price that you pay for conformity is lack of creativity > ============================= > > -- > You received this message because you are subscribed to the Google Groups > "Seattle area Alt.Net" group. > To post to this group, send email to altnetseat...@googlegroups.com. > To unsubscribe from this group, send email to > altnetseattle+unsubscr...@googlegroups.com<altnetseattle%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/altnetseattle?hl=en. > -- You received this message because you are subscribed to the Google Groups "Seattle area Alt.Net" group. To post to this group, send email to altnetseat...@googlegroups.com. To unsubscribe from this group, send email to altnetseattle+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/altnetseattle?hl=en.