views:

38

answers:

1

In my MVP pattern (Passive view) based application (.NET), I have separated out the message boxes into the View so that when I test 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?

+2  A: 

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.

Obalix