Click here to Skip to main content
15,799,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After a test method failed, there is a Message about this failure in the "Test Explorer" window. It will look like below

Test Failed - TC0001 Message: Test method ParallelsAutomation.TestCases.APS2.UnitTest1.U1TC_001 threw exception: System.DivideByZeroException: Attempted to divide by zero.

Could anyone help me get this message in code since I don't want to try catch the test method?
Nathan Minier 13-Nov-14 7:09am    
You probobly have an int variable that's not assigned properly (ints default to 0).
Dominic Burford 13-Nov-14 8:54am    
You need to fix the unit test not trap the error message.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900