FancyZones and Shortcut Guide initial commit

Co-authored-by: Alexis Campailla <alexis@janeasystems.com>
Co-authored-by: Bret Anderson <bretan@microsoft.com>
Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Jeff Bogdan <jeffbog@microsoft.com>
Co-authored-by: March Rogers <marchr@microsoft.com>
Co-authored-by: Mike Harsh <mharsh@microsoft.com>
Co-authored-by: Nachum Bundak <Nachum.Bundak@microsoft.com>
Co-authored-by: Oliver Jones <ojones@microsoft.com>
Co-authored-by: Patrick Little <plittle@microsoft.com>
This commit is contained in:
Bartosz Sosnowski
2019-09-04 18:26:26 +02:00
committed by Bartosz Sosnowski
parent 10c5396099
commit 8431b80e48
341 changed files with 54766 additions and 62 deletions

View File

@@ -0,0 +1,36 @@
#include "pch.h"
#include "lib\RegistryHelpers.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace FancyZonesUnitTests
{
TEST_CLASS(RegistryHelpersUnitTests)
{
public:
TEST_METHOD(GetDefaultKey)
{
// Test the path to the key is the same string.
wchar_t key[256];
Assert::AreEqual(0, wcscmp(RegistryHelpers::GetKey(nullptr, key, ARRAYSIZE(key)), L"Software\\SuperFancyZones"));
}
TEST_METHOD(GetKeyWithMonitor)
{
// Test the path to the key is the same string.
wchar_t key[256];
Assert::AreEqual(0, wcscmp(RegistryHelpers::GetKey(L"Monitor1", key, ARRAYSIZE(key)), L"Software\\SuperFancyZones\\Monitor1"));
}
TEST_METHOD(OpenKey)
{
// The default key should exist.
wil::unique_hkey key{ RegistryHelpers::OpenKey({}) };
Assert::IsNotNull(key.get());
// The Monitor1 key shouldn't exist.
wil::unique_hkey key2{ RegistryHelpers::OpenKey(L"Monitor1") };
Assert::IsNull(key2.get());
}
};
}