hi all,
I am new to c++ and is trying to figure out how unit testing works in Visual Studio. The firt problem i have, is that my test class cannot find the class i want to instantiate.
The program i am testing has a class called Cat_Population_Manager, and the test code is this:
Code:
#include "stdafx.h"
using namespace System;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace Microsoft::VisualStudio::TestTools::UnitTesting;
namespace CatTesting
{
[TestClass]
public ref class Cat_Test
{
public:
[TestMethod]
void TestMethod1()
{
Cat_Population_Manager manager;
Assert.IsNotNull(manager);
}
};
}
And the error goes like this:
1>------ Build started: Project: CatTesting, Configuration: Debug Win32 ------
1> Cat_Test.cpp
1>Cat_Test.cpp(17): error C2065: 'Cat_Population_Manager' : undeclared identifier
1>Cat_Test.cpp(17): error C2146: syntax error : missing ';' before identifier 'manager'
1>Cat_Test.cpp(17): error C2065: 'manager' : undeclared identifier
1>Cat_Test.cpp(18): error C2143: syntax error : missing ';' before '.'
1>Cat_Test.cpp(18): error C2143: syntax error : missing ';' before '.'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
So Cat_Population_Manager is undeclared :-(
Have tried for two days now, to make this work, but cant figure out how to declare it.
Please help me...