开发者

MVP : Dialog boxes that return value and testable code

In my MVP pattern (Passive view) based application (.NET), I have separated out the message boxes into the View so that when I tes开发者_运维问答t my presenter and model my testing code is not affected by the need to show user some information. But I don't know how to accommodate dialog boxes, when user's input is required to decide on a course of action. So, how do we make dialog boxes work in MVP?


You can make the tests work by mocking the View while testing the presenter. Mocking allows you to return values for a given method of the View and thus simulating the user input.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜