Difference between Stub object and Mock object in Unit Test
Jul 29, 2017 · 1 min read
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.