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.
Show your support

Clapping shows how much you appreciated Anil Sutariya’s story.