Unable to fail C# test using assert.fail method

2.7k views Asked by At

I am creating a test in codedUI, VS2013. I am using assert.fail(failuredescripion) inside my exception class. But I am getting the below mentioned error:

An exception of type 'Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException' occurred in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll but was not handled in user code
Additional information: Assert.Fail failed.

Can anyone please suggest how to achieve this? I want the failure to be recorded forcefully.

1

There are 1 answers

1
SmackCoder On

I found answer from this MSDN post

This error is happening because of the exception options. Need to add an exception for the assert namespace and disable both user handled and Thrown in Debug-->Exceptions