Better tests and error messages for mocks