我创建了一个空白的C++ Uinversal Windows App, 在工程中创建了一个Class1.h的类:
#include "pch.h"
#include "Class1.h"
using namespace App1;
using namespace Platform;
Class1::Class1()
{
}
int Class1::CalculateNum(int num)
{
return 3;
}
在新建一个Unit Test App(Universal Windows)工程,Add Reference->App1添加引用,在生成的UnitTest.CPP中添加如下代码:
#include "pch.h"
#include "CppUnitTest.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace Platform;
namespace UnitTestApp1
{
TEST_CLASS(UnitTest1)
{
public:
TEST_METHOD(TestMethod1)
{
// TODO: Your test code here
App1::Class1^ cls = ref new App1::Class1();
Assert::AreEqual(cls->CalculateNum(2),3);
}
};
}
编译没有问题,但Run->All Tests,报如下问题:

就是很简单的测试逻辑,这是啥情况呢?