-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some refactoring of FancyZones::IsInterestingWindow and added Unit Te…
…sts (#1521) * Some refactoring of FancyZones::IsInterestingWindow and added UnitTests
- Loading branch information
1 parent
04027b9
commit 02857d1
Showing
6 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include "pch.h" | ||
#include "common.h" | ||
|
||
using namespace Microsoft::VisualStudio::CppUnitTestFramework; | ||
|
||
namespace UnitTestsCommon | ||
{ | ||
TEST_CLASS (CommonUtils) | ||
{ | ||
std::vector<std::wstring> what_global{ | ||
L"TELEGRAM", | ||
L"SUBLIME TEXT", | ||
L"PROGRAM", | ||
L"TEXT", | ||
}; | ||
|
||
TEST_METHOD (FindAppNameInPathTest1) | ||
{ | ||
std::wstring where(L"C:\\USERS\\GUEST\\APPDATA\\ROAMING\\TELEGRAM DESKTOP\\TELEGRAM.EXE"); | ||
bool ans = find_app_name_in_path(where, what_global); | ||
Assert::IsTrue(ans); | ||
} | ||
TEST_METHOD (FindAppNameInPathTest2) | ||
{ | ||
std::vector<std::wstring> what{ | ||
L"NOTEPAD", | ||
}; | ||
std::wstring where(L"C:\\PROGRAM FILES\\NOTEPAD++\\NOTEPAD++.EXE"); | ||
bool ans = find_app_name_in_path(where, what); | ||
Assert::IsTrue(ans); | ||
} | ||
TEST_METHOD (FindAppNameInPathTest3) | ||
{ | ||
std::vector<std::wstring> what{ | ||
L"NOTEPAD++.EXE", | ||
}; | ||
std::wstring where(L"C:\\PROGRAM FILES\\NOTEPAD++\\NOTEPAD++.EXE"); | ||
bool ans = find_app_name_in_path(where, what); | ||
Assert::IsTrue(ans); | ||
} | ||
TEST_METHOD (FindAppNameInPathTest4) | ||
{ | ||
std::wstring where(L"C:\\PROGRAM FILES\\SUBLIME TEXT 3\\SUBLIME_TEXT.EXE"); | ||
bool ans = find_app_name_in_path(where, what_global); | ||
Assert::IsFalse(ans); | ||
} | ||
TEST_METHOD (FindAppNameInPathTest5) | ||
{ | ||
std::vector<std::wstring> what{ | ||
L"NOTEPAD.EXE", | ||
}; | ||
std::wstring where(L"C:\\PROGRAM FILES\\NOTEPAD++\\NOTEPAD++.EXE"); | ||
bool ans = find_app_name_in_path(where, what); | ||
Assert::IsFalse(ans); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters