Refactored tests to use dedicated mock and stub objects