This code smell, or rather test smell, runs opposite to the fundamental law of mocking, only mock what you own.
In Growing Object-Oriented Software Guided by Tests, Freeman and Pryce go on to say –
- Don’t mock value objects
- Don’t mock third-party libraries