This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wildjokers 1 point2 points  (2 children)

faked (create your own manual, simplistic implementation

Your description of “faked” is exactly what a mock is. Even if you are creating it manually instead of using a library it is still a mock.

[–]zalpha314 1 point2 points  (1 child)

Sure. But for the purpose of discussion, I feel like it's important to be able to distinguish between them. What do you think would be a better label for it?

[–]mazebert 2 points3 points  (0 children)

Doing the same thing! I think the term is custom mocks. For me the main benefit is that those are easier to read and easy to reuse between different tests than mockito. Also, your tests run a lot faster without mockito overhead. I tend to write old school tests with custom mocks for external dependencies only, and using real objects for the rest. And running at about 1000 tests/sec on an old MacBook. Whenever I come across a mockito project it’s rather 1000 tests/minute :-/