开发者

how to suppress a message box while unit testing?

I am using VS2008 and created a unit testing project therein to test my co开发者_如何学Gomponent. 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


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜