سؤال

looking at asmock examples (http://asmock.sourceforge.net/wiki/Quick_Start_Guide) i noticed that whenever the setup of the mock is complete (settings of returnValue etc) replay or replayall is called. I am not sure of what is the purpose of calling them and is it mandatory. can someone clarify this ?

Thanks

هل كانت مفيدة؟

المحلول

When mocks are first created they are placed into "record" mode, whereby method calls don't do anything but can be programmed to act as is required. In order to use the mock as it has been configured, it needs to change to "replay" mode. replayAll simply changes all mocks created by that repository into replay mode with one call.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top