- 全般→構成の種類をdllにする
- C/C++→インクルードディレクトリに
$(VCInstallDir)UnitTest\include
を追加 - リンカー→追加のライブラリディレクトリに
$(VCInstallDir)UnitTest\lib
を追加 - テストの実行はテストエクスプローラから実行
#if _DEBUG
#include <CppUnitTest.h>
#include <CppUnitTestAssert.h>
#include <CppUnitTestLogger.h>
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace TestClassName
{
TEST_CLASS(TestClassName)
{
public:
TEST_METHOD(TestCaseName)
{
Assert::AreEqual(3, 3);
}
};
};
#endif