Hi,
when testing Forms (e.g. with NUnitForms) I test what happens when users click a button. Ahead I set the expectations. When TypeMock encounters an error (e.g. "Unexpected Call to xxx") it throws an exception. Usually its caught by nunit, but in this case the call stack goes back to the message loop. That means the "Unhandled exception has occured" dialog comes up.
As we have automatic tests running a dialog is what we do not expect.
So I tried AppDomain.CurrentDomain.UnhandledException event catching but it did not work at all as the testing class is not in the initial domain.
Does anybody have an idea how to avoid this exception dialog?
I know this problem is not (only) a typical TypeMock issue but perhaps someone can help me in this forum.
Thanks for any help
when testing Forms (e.g. with NUnitForms) I test what happens when users click a button. Ahead I set the expectations. When TypeMock encounters an error (e.g. "Unexpected Call to xxx") it throws an exception. Usually its caught by nunit, but in this case the call stack goes back to the message loop. That means the "Unhandled exception has occured" dialog comes up.
As we have automatic tests running a dialog is what we do not expect.
So I tried AppDomain.CurrentDomain.UnhandledException event catching but it did not work at all as the testing class is not in the initial domain.
Does anybody have an idea how to avoid this exception dialog?
I know this problem is not (only) a typical TypeMock issue but perhaps someone can help me in this forum.
Thanks for any help
This is actually a problem, and apart from setting up your own error handler, there should probrably have an option to defer throwing the exceptions till the Verify() is called (actually using VerifyWithTimeout() already rethrows these exceptions and it makes more sense to use it in this case as this is a Threaded tests, but TypeMock doesn't have an option not to throw these errors in the first place).
Even with this you might still have problems testing failures in your code.
I will see if we can add this to the coming version
Even with this you might still have problems testing failures in your code.
I will see if we can add this to the coming version