mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[KBM] decoupling editor and engine (#11133)
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
#include "pch.h"
|
||||
#include "CppUnitTest.h"
|
||||
#include <keyboardmanager/KeyboardManagerEditorLibrary/BufferValidationHelpers.h>
|
||||
#include "TestHelpers.h"
|
||||
#include <common/interop/keyboard_layout.h>
|
||||
#include <common/interop/shared_constants.h>
|
||||
#include <functional>
|
||||
#include <keyboardmanager/common/ErrorTypes.h>
|
||||
#include <keyboardmanager/KeyboardManagerEditorLibrary/ShortcutErrorType.h>
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
using namespace TestHelpers;
|
||||
|
||||
namespace RemappingUITests
|
||||
{
|
||||
@@ -61,10 +59,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when -1 i.e. null selection is made on an empty row.
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 0, 0, -1 };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is validated and buffer is updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[0].first[0]));
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[0].first[1]));
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[1].first[0]));
|
||||
@@ -81,10 +79,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting B on an empty row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 0, 0, 0x42 };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is validated and buffer is updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual((DWORD)0x42, std::get<DWORD>(remapBuffer[0].first[0]));
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[0].first[1]));
|
||||
}
|
||||
@@ -99,10 +97,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting B on a row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 0, 0, 0x42 };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is validated and buffer is updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual((DWORD)0x42, std::get<DWORD>(remapBuffer[0].first[0]));
|
||||
Assert::AreEqual((DWORD)0x41, std::get<DWORD>(remapBuffer[0].first[1]));
|
||||
}
|
||||
@@ -117,10 +115,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting B on a row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 0, 0, 0x42 };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is validated and buffer is updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual((DWORD)0x42, std::get<DWORD>(remapBuffer[0].first[0]));
|
||||
Assert::AreEqual(true, Shortcut(std::vector<int32_t>{ VK_CONTROL, 0x41 }) == std::get<Shortcut>(remapBuffer[0].first[1]));
|
||||
}
|
||||
@@ -135,10 +133,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting A on a row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 0, 0, 0x41 };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is invalid and buffer is not updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::MapToSameKey);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::MapToSameKey);
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[0].first[0]));
|
||||
Assert::AreEqual((DWORD)0x41, std::get<DWORD>(remapBuffer[0].first[1]));
|
||||
}
|
||||
@@ -154,10 +152,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting A on second row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 1, 0, 0x41 };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is invalid and buffer is not updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::SameKeyPreviouslyMapped);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::SameKeyPreviouslyMapped);
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[1].first[0]));
|
||||
Assert::AreEqual((DWORD)0x43, std::get<DWORD>(remapBuffer[1].first[1]));
|
||||
}
|
||||
@@ -173,10 +171,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting A on second row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 1, 0, 0x41 };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is invalid and buffer is not updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::SameKeyPreviouslyMapped);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::SameKeyPreviouslyMapped);
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[1].first[0]));
|
||||
Assert::AreEqual(true, Shortcut(std::vector<int32_t>{ VK_CONTROL, 0x41 }) == std::get<Shortcut>(remapBuffer[1].first[1]));
|
||||
}
|
||||
@@ -192,10 +190,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting LCtrl on second row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 1, 0, VK_LCONTROL };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is invalid and buffer is not updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::ConflictingModifierKey);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::ConflictingModifierKey);
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[1].first[0]));
|
||||
Assert::AreEqual((DWORD)0x43, std::get<DWORD>(remapBuffer[1].first[1]));
|
||||
}
|
||||
@@ -211,10 +209,10 @@ namespace RemappingUITests
|
||||
|
||||
// Validate and update the element when selecting LCtrl on second row
|
||||
ValidateAndUpdateKeyBufferElementArgs args = { 1, 0, VK_LCONTROL };
|
||||
KeyboardManagerHelper::ErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
ShortcutErrorType error = BufferValidationHelpers::ValidateAndUpdateKeyBufferElement(args.elementRowIndex, args.elementColIndex, args.selectedCodeFromDropDown, remapBuffer);
|
||||
|
||||
// Assert that the element is invalid and buffer is not updated
|
||||
Assert::AreEqual(true, error == KeyboardManagerHelper::ErrorType::ConflictingModifierKey);
|
||||
Assert::AreEqual(true, error == ShortcutErrorType::ConflictingModifierKey);
|
||||
Assert::AreEqual((DWORD)NULL, std::get<DWORD>(remapBuffer[1].first[0]));
|
||||
Assert::AreEqual(true, Shortcut(std::vector<int32_t>{ VK_CONTROL, 0x41 }) == std::get<Shortcut>(remapBuffer[1].first[1]));
|
||||
}
|
||||
@@ -268,10 +266,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and no drop down action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -295,10 +293,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no drop down action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutStartWithModifier);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutStartWithModifier);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -318,10 +316,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and no drop down action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -341,10 +339,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no drop down action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutNotMoreThanOneActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutNotMoreThanOneActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -364,10 +362,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no drop down action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutNotMoreThanOneActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutNotMoreThanOneActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -395,10 +393,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and no drop down action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -426,10 +424,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and ClearUnusedDropDowns action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::ClearUnusedDropDowns);
|
||||
});
|
||||
}
|
||||
@@ -447,10 +445,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and ClearUnusedDropDowns action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::ClearUnusedDropDowns);
|
||||
});
|
||||
}
|
||||
@@ -482,10 +480,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and AddDropDown action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::AddDropDown);
|
||||
});
|
||||
}
|
||||
@@ -509,10 +507,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutCannotHaveRepeatedModifier);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutCannotHaveRepeatedModifier);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -546,10 +544,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutMaxShortcutSizeOneActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutMaxShortcutSizeOneActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -577,10 +575,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutMaxShortcutSizeOneActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutMaxShortcutSizeOneActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -614,10 +612,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -651,10 +649,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutCannotHaveRepeatedModifier);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutCannotHaveRepeatedModifier);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -674,10 +672,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutStartWithModifier);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutStartWithModifier);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -695,10 +693,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutOneActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutOneActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -722,10 +720,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutAtleast2Keys);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutAtleast2Keys);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -749,10 +747,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutOneActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutOneActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -776,10 +774,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and DeleteDropDown action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::DeleteDropDown);
|
||||
});
|
||||
}
|
||||
@@ -819,10 +817,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid and DeleteDropDown action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::DeleteDropDown);
|
||||
});
|
||||
}
|
||||
@@ -850,10 +848,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid and no action is required
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutOneActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutOneActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
});
|
||||
}
|
||||
@@ -889,10 +887,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::WinL);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::WinL);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -921,10 +919,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::WinL);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::WinL);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -953,10 +951,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::CtrlAltDel);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::CtrlAltDel);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -987,10 +985,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::MapToSameKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::MapToSameKey);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1025,10 +1023,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::MapToSameShortcut);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::MapToSameShortcut);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1103,10 +1101,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::MapToSameShortcut);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::MapToSameShortcut);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1129,10 +1127,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::SameShortcutPreviouslyMapped);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::SameShortcutPreviouslyMapped);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1157,10 +1155,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1183,10 +1181,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ConflictingModifierShortcut);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ConflictingModifierShortcut);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1209,10 +1207,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1249,10 +1247,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::SameShortcutPreviouslyMapped);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::SameShortcutPreviouslyMapped);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1289,10 +1287,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1329,10 +1327,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is invalid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ConflictingModifierShortcut);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ConflictingModifierShortcut);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1369,10 +1367,10 @@ namespace RemappingUITests
|
||||
remapBuffer.push_back(testCase.bufferRow);
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(testCase.elementRowIndex, testCase.elementColIndex, testCase.indexOfDropDownLastModified, testCase.selectedCodesOnDropDowns, testCase.targetAppNameInTextBox, testCase.isHybridColumn, remapBuffer, true);
|
||||
|
||||
// Assert that the element is valid
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::NoError);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::NoError);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1388,10 +1386,10 @@ namespace RemappingUITests
|
||||
};
|
||||
|
||||
// Act
|
||||
std::pair<KeyboardManagerHelper::ErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(0, 1, 1, selectedCodes, testApp1, true, remapBuffer, true);
|
||||
std::pair<ShortcutErrorType, BufferValidationHelpers::DropDownAction> result = BufferValidationHelpers::ValidateShortcutBufferElement(0, 1, 1, selectedCodes, testApp1, true, remapBuffer, true);
|
||||
|
||||
// Assert
|
||||
Assert::AreEqual(true, result.first == KeyboardManagerHelper::ErrorType::ShortcutDisableAsActionKey);
|
||||
Assert::AreEqual(true, result.first == ShortcutErrorType::ShortcutDisableAsActionKey);
|
||||
Assert::AreEqual(true, result.second == BufferValidationHelpers::DropDownAction::NoAction);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user