3 ms·
I used to think this way, but now I believe that any method requiring writing code in a different way than the more natural one for the sake of tests is subopti
by strulovich 3y ago
I used to think this way, but now I believe that any method requiring writing code in a different way than the more natural one for the sake of tests is suboptimal.
People generally call time functions, and a good testing setup should keep your code the same (or mostly the same).
Anything else makes testing less approachable, and requires extra time from developers.
The provider and mocking (or a fake if you got one) approach is probably the best you can get with most programming languages.