jeudi 23 avril 2015

Kiwi: concrete difference between mock and nullMock?

I'm using Kiwi on a project and am not quite clear on when to use a mock versus a nullMock. Here is what Kiwi's documentation currently provides:

A plain mock object will raise an exception when it receives a selector or message pattern that it does not expect. Expected messages are automatically added to a mock when stub or receive expectations are used on a mock.

If you don't care about mocks receiving other messages, and don't want exceptions to be raised, then use a null mock (also known as a null object).

It what kind of scenario would this difference come into play?

Aucun commentaire:

Enregistrer un commentaire