Reputation: 6252
I'm using Visual Studio 2008's built in testing framework in my Visual C++ project. I'm adding a new Test Project, then a new Unit Test. However, I can't use any of the functions provided by Assert. Assert shows up in the Intellisense, but I can't do anything with it. I've done unit tests fine in Visual C#. Am I forgetting to do anything?
EDIT: There isn't much code because everything I'm doing is auto-generated by Visual Studio 2008. Here are the steps I'm doing:
From here, when I try to use the Assert class (like Assert.AreEqual), I can't do it. If I do the same in a Visual C# project, it works fine.
Upvotes: 2
Views: 1981
Reputation: 66
AreEqual is a static method in Assert class. So use Assert::AreEqual(...)
Upvotes: 5
Reputation: 61893
See http://msdn.microsoft.com/en-us/library/ms243171(VS.80).aspx
Are you trying to write tests in [unmanaged] C++? If so, you could use CppUnit.
If you're trying to do it in managed C++, are you referencing the Microsoft.VisialStudio.QualityTools assembly?
If not, the assert or Assert you're seeing are probably the standard library and MFC things respectively?
You're not giving us much to go on. Sample? Project type you used to create the project?
Upvotes: -1