KBM - Set up tests for keyboard hook remapping logic (#4004)

* Add test proj, refactor proj with filters, and move single remap function to a separate header

* Moved all methods to header files

* remove more unused commented code

* Reverted sln file

* Fixed sln file

* Added interface wrapping SendInput calls

* fixed formatting

* Created test mock class

* Added keyboard input logic

* Fixed compilation errors and added nuget reference to CppWinRT

* Added tests for single key remapping

* Refactored code for adding shortcut remap tests

* Separated test classes

* Fixed tests in release mode

* Added more tests

* Resolved comments
This commit is contained in:
Arjun Balgovind
2020-06-11 13:07:46 -07:00
committed by GitHub
parent 670033c4da
commit 071ea1dc97
30 changed files with 1866 additions and 66 deletions

View File

@@ -0,0 +1,14 @@
#include "pch.h"
#include "TestHelpers.h"
namespace TestHelpers
{
// Function to reset the environment variables for tests
void ResetTestEnv(MockedInput& input, KeyboardManagerState& state)
{
input.ResetKeyboardState();
input.SetHookProc(nullptr);
state.ClearSingleKeyRemaps();
state.ClearOSLevelShortcuts();
}
}