3 ms·
I can speculate as to why this would happen. People expect unit-tested code to have shorter methods because it's easier to write tests for shorter methods. How
by spjt 9y ago
I can speculate as to why this would happen. People expect unit-tested code to have shorter methods because it's easier to write tests for shorter methods.
However, writing a new test for a new method can be harder than just stuffing that code in some other method that already has a test. Depending on how testing is enforced, you might be able to at get away with not having to do anything at all if the existing test still passes. If you're in a hurry and the test fails, just change the assertion to whatever happens. Is it right? I dunno, the test says it's working.