Difference between Stub object and Mock object in Unit Test

Stub object. A stub object (also known as a stub), is a fake
 object that can be used in place of a real dependency, is significantly easier to instantiate, and provides harmless method implementations of the object it is trying to emulate.
Mock object. A mock object (also known as a mock), is similar to a stub. However, the key difference is that a mock is used in a test assertion, or asserted against.
Like what you read? Give Anil Sutariya a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.