Could you please explain me difference between expect and stub in ocmock using objective c.
I am too much confuse there is no proper explanation on that.
Someone answer this as -:
The basic difference is this: you expect things that must happen, and stub things that might happen.
There are 2 ways mock objects fail: either an unexpected/unstubbed method is called, or an expected method is not called.
Unexpected invocations. When a mock object receives a message that hasn't been either stubbed or expected, it throws an exception immediately and your test fails.
Expected invocations. When you call verify on your mock (generally at the end of your test), it checks to make sure all of the methods you expected were actually called. If any were not, your test will fail.
Please help on this topic.