Unit Testing mixed assemblies

G

Guest

I have a dll assembly compiler with the /clr flag as it contains ref classes
and traditional style C++ classes.

I want to write unit tests for the ref classes in that assembly. VS2005
allows me to author such a test, but at runtime I get the following exception

Test method TestProject2.MPersistTest.GetFiveTest threw exception:
System.IO.FileNotFoundException: The specified module could not be found.
(Exception from HRESULT: 0x8007007E).

MSDN has the following statements:

Mixed. A mixed project is a project that uses the /clr compiler option. If
your production code is mixed, and not an executable file, any callable
method in your code can be called and tested.

Production code project. If your production code is written in Visual C++,
you can generate unit tests only if your product uses the /clr:safe compiler
option.

On the same page which appear to be contradictory.

The assembly in question has been strongly signed (well delay signed) and
installed in the GAC, yet the test framework is still having problems with it.

Does nay one know:
1) Whether I can actually get the unit test functionality working with mixed
assemblies
2) If so, what is the matter with this one?

Thanks

Colin
 
H

Holger Grund

Colin Desmond said:
I have a dll assembly compiler with the /clr flag as it contains ref
classes
and traditional style C++ classes.

I want to write unit tests for the ref classes in that assembly. VS2005
allows me to author such a test, but at runtime I get the following
exception

Test method TestProject2.MPersistTest.GetFiveTest threw exception:
System.IO.FileNotFoundException: The specified module could not be found.
(Exception from HRESULT: 0x8007007E).
This might be due to a missing manifest (/clr implies /MD). Can you
debug the test project?
Enable NT LDR output to determine the error (use gflags or just set
*(char*){,,ntdll.dll}_ShowSnaps=1 before the library is loaded)
Does nay one know:
1) Whether I can actually get the unit test functionality working with
mixed
assemblies

I'm fairly certain you can. I guess, the restriction is about generating
a test skeleton only.

-hg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top