Jaqen H'ghar
Jaqen H'ghar

Reputation: 1879

how to suppress a message box while unit testing?

I am using VS2008 and created a unit testing project therein to test my component. While running unit tests for invalid test cases, i am getting message box. And for each such message box, i need to click it to proceed. I want to avoid the manual intervention needed for these message boxes. Is there any way to suppress them programatically? All these messages are with OK button only. Any help.

tia, kapil

Upvotes: 3

Views: 2539

Answers (1)

Gishu
Gishu

Reputation: 136683

You need to design for testability. Search for the "Humble Dialog Box", which explains how to get around modal dialog boxes in tests.

Another answer that might help you out.

Upvotes: 1

Related Questions