4 ms·
If you can't put the thing you're testing (method, class, application) in the state you want to test using only public methods you are not testing something use
by arkh 8y ago
If you can't put the thing you're testing (method, class, application) in the state you want to test using only public methods you are not testing something useful. If you're doing to get 100% coverage be happy: that's dead code you can remove.
- viraptor 8y agoCounterexample: Testing something that uses your language's Array.shuffle equivalent which doesn't expose the randomness provider. You can't put it in the right state without just stubbing the call and making it return the order you want.