4 ms·
I guess we have used different mocking libraries. The ones I'm most familiar with start with very simple use cases ("here is an object that looks like this Clas
by rco8786 2y ago
I guess we have used different mocking libraries. The ones I'm most familiar with start with very simple use cases ("here is an object that looks like this Class, and when you call function X on it, return Y") and don't appear to have any noticeable amount of performance degradation.
One could just as easily have each class/file export a mocked object rather than a real one that happens to do nothing.
That angle of it though, I can see being beneficial. Where each class has the responsibility of defining how it should be used in a test case, vs each individual test case having to define the mocking behavior for any class it touches.
- cratermoon 2y agohttps://martinfowler.com/articles/mocksArentStubs.html#TheDifferenceBetweenMocksAndStubs https://martinfowler.com/articles/mocksArentStubs.html#TheDi...