2019-09-04 18:26:26 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-02-10 14:59:51 +01:00
|
|
|
#include "lib/JsonHelpers.h"
|
|
|
|
|
|
2019-09-04 18:26:26 +02:00
|
|
|
namespace CustomAssert
|
|
|
|
|
{
|
|
|
|
|
static void AreEqual(const RECT& r1, const RECT& r2)
|
|
|
|
|
{
|
|
|
|
|
const bool equal = ((r1.left == r2.left) && (r1.right == r2.right) && (r1.top == r2.top) && (r1.bottom == r2.bottom));
|
|
|
|
|
Microsoft::VisualStudio::CppUnitTestFramework::Assert::IsTrue(equal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void AreEqual(GUID g1, GUID g2)
|
|
|
|
|
{
|
|
|
|
|
Microsoft::VisualStudio::CppUnitTestFramework::Assert::IsTrue(g1 == g2);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 14:59:51 +01:00
|
|
|
static void AreEqual(JSONHelpers::ZoneSetLayoutType t1, JSONHelpers::ZoneSetLayoutType t2)
|
2019-09-04 18:26:26 +02:00
|
|
|
{
|
2020-02-10 14:59:51 +01:00
|
|
|
Microsoft::VisualStudio::CppUnitTestFramework::Assert::IsTrue(t1 == t2);
|
2019-09-04 18:26:26 +02:00
|
|
|
}
|
2020-03-24 18:50:26 +01:00
|
|
|
|
|
|
|
|
static void AreEqual(const std::vector<std::pair<HMONITOR, RECT>>& a1, const std::vector<std::pair<HMONITOR, RECT>>& a2)
|
|
|
|
|
{
|
|
|
|
|
Microsoft::VisualStudio::CppUnitTestFramework::Assert::IsTrue(a1.size() == a2.size());
|
|
|
|
|
for (size_t i = 0; i < a1.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
Microsoft::VisualStudio::CppUnitTestFramework::Assert::IsTrue(a1[i].first == a2[i].first);
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-04 18:26:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Mocks
|
|
|
|
|
{
|
|
|
|
|
static HWND Window()
|
|
|
|
|
{
|
|
|
|
|
static UINT_PTR s_nextWindow = 0;
|
|
|
|
|
return reinterpret_cast<HWND>(++s_nextWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HMONITOR Monitor()
|
|
|
|
|
{
|
|
|
|
|
static UINT_PTR s_nextMonitor = 0;
|
|
|
|
|
return reinterpret_cast<HMONITOR>(++s_nextMonitor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HINSTANCE Instance()
|
|
|
|
|
{
|
|
|
|
|
static UINT_PTR s_nextInstance = 0;
|
|
|
|
|
return reinterpret_cast<HINSTANCE>(++s_nextInstance);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 14:59:51 +01:00
|
|
|
HWND WindowCreate(HINSTANCE hInst);
|
|
|
|
|
}
|
2020-03-17 00:29:13 +03:00
|
|
|
|
|
|
|
|
namespace Helpers
|
|
|
|
|
{
|
|
|
|
|
std::wstring GuidToString(const GUID& guid);
|
|
|
|
|
std::wstring CreateGuidString();
|
|
|
|
|
}
|