4 ms·
Our systems generally rely on a (dependency injected) 'currentDateTimeService'. In unit-tests, the currentDateTimeService is dependency-injected with a mock ser
by edejong 11y ago
Our systems generally rely on a (dependency injected) 'currentDateTimeService'. In unit-tests, the currentDateTimeService is dependency-injected with a mock service, always returning the same date.
But here, I guess the better solution would be to fix the tested code: don't gracefully fall-back, but fail fast. I've seen too many places where graceful defaulting code ended up corrupting important data.