What is the purpose of mock objects?

Viewed 79727

I am new to unit testing, and I continously hear the words 'mock objects' thrown around a lot. In layman's terms, can someone explain what mock objects are, and what they are typically used for when writing unit tests?

11 Answers

It's one of the main perspectives of unit tests. yes, you're trying to test your single unit of code and your test results should not be relevant to other beans or objects behavior. so you should mock them by using Mock objects with some simplified corresponding response.

Related