Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 939
Jaqen H'ghar Avatar asked Dec 04 '25 10:12

Jaqen H'ghar


1 Answers

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.

like image 181
Gishu Avatar answered Dec 07 '25 03:12

Gishu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!