3 ms·
Testing frameworks exit and rebuild the app runtime environment all the time, to isolate the effects of one test case from the next. When your singleton instant
by Confusion 15y ago
Testing frameworks exit and rebuild the app runtime environment all the time, to isolate the effects of one test case from the next. When your singleton instantiation is paramatrized, for instance with a configuration file, than there is no testability problem whatsoever.
I would go as far as to say that if you have to do multiple "application runs" in the same "test run", where these "application runs" require different configurations to have the test cover some specific scenario, then your code has larger problems than having the configuration in a singleton.