You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the test raises an Unhandled Exception and I have got this message :
Test method SerialPortProviderTests.OpenTest_ThrowException_CloseCalled threw exception:
System.Reflection.TargetInvocationException: An exception was thrown by the target of a call. ---> System.Exception: An exception of type 'System.Exception' was thrown.
The text was updated successfully, but these errors were encountered:
gismail
changed the title
Make my function throw an exception
Question : Make my function throw an exception
Jul 20, 2021
I tried to make a function
serialPortC.Open()
throw an exception in that way :Shim shimserialPortCOpen = Shim.Replace(() => serialPortC.Open()).With(delegate (SerialPort @this) { throw new Exception(); });
to check after if
Close
function is called or Not.And my source code is :
And my test Code is :
However, the test raises an Unhandled Exception and I have got this message :
The text was updated successfully, but these errors were encountered: