tags:

views:

39

answers:

2

Does any one know if I can test native code in VS Test 2010?

A: 

Apparently not according to the docs here.

You cannot have test projects with unit tests that use unmanaged C++.

This is confirmed by MSFT here.

Steve Townsend
This is not entirely true
Greg Domjan
@Greg - let me know why not and I will edit
Steve Townsend
A: 

There was another question here on the stack that I can't find, but it linked me off to How Do I: Create and Run Unit Tests in Visual C++?

This shows that you can unit test native code including C++ but to do so you would still write the unit tests in managed code.

I have not tried this in person, and one thing I noticed was the demo used the COM interface to test the C++ native code, so have no specific experience of using C++ classes more directly in the unit test.

Greg Domjan