4 ms·
Each of these things prevents isolated testing of dependent components. For that reason alone they are nonstarters.
by sagichmal 5y ago
Each of these things prevents isolated testing of dependent components. For that reason alone they are nonstarters.
- ori_b 5y agoglobalvar = new NopImpl() works fine for testing. If you squint, you can even think of dependency injection frameworks like Dagger as a lot of boilerplate around a global database of instantiations.
- deleted 5y ago[deleted]
- dcow 5y agoUntil you try to run two tests at once, one which requires NopImpl and one which requires the real impl.
- sagichmal 5y agoAs dcow pointed out, it really doesn't work fine for testing, as it couples what should be isolated tests together, and prevents them from being executed concurrently.