I've got a CLI/CPP wrapper library which wraps a native C++ library.
The native library completes some of it's processing asynchronously on separate threads.
That wrapper is then available to be consumed by .Net (managed) clients.
I'm trying to write a series of unit tests to test the CLI/CPP layer.
I'm using the default "Microsoft Test" which is available with Visual Studio 2013.
I also have a Console Test application which completes the same basic functionality.
When running my tests, I get the following error:
An unhandled exception of type 'MyNameSpace.MyException' occurred in my-wrapper-cli.dll
Additional information: Unable to cast object of type 'System.__ComObject' to type 'MYNameSpace.Frame'.
// frame is an unmanaged object
// Create a handle to a "managed" Frame - based on unmanaged one
MYNameSpace::Frame^ imageFrame = gcnew MyNameSpace::Frame(frame);
// Call back to the .Net/Managed client with a handle to the managed object
The code throws the exception on the callback routine.
As I previously stated, the above code snippet works when I'm not processing through the test frame work.
I've tried using NUnit along with the VS NUnit adapter, but I still get the same results
Are there known issues using Microsoft's Test to test asynchronous/multi-threade
d CLI/CPP libraries?
Is there a compiler switch I'm missing somewhere?
Should I just base my unit test on a console app to remove the reliance on UnitTestFramework?