3 ms·
Those are all code smells. Unit tests should only change if you also change public apis (I have one exception to this rule, which is very complex private metho
by joshuamorton 8y ago
Those are all code smells.
Unit tests should only change if you also change public apis (I have one exception to this rule, which is very complex private methods which could easily be their own unit).
Then if you're changing the tests, you're also refactoring everything else.
>For example if you use mocks to invocation counts, refactorings can be even more costly.
These should only be costly if you're over-testing. You shouldn't be mocking and asserting calls on every call within a system under test, you should be checking the ones that matter.
Correctly written unit tests are a refactoring aid.