开发者

how to suppress a message box while unit testing?

开发者 https://www.devze.com 2023-02-01 13:06 出处:网络
I am using VS2008 and created a unit testing project therein to test my co开发者_如何学Gomponent.

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

精彩评论

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