-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add [window] minimize action (#17)
- Loading branch information
Showing
13 changed files
with
93 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
name: Release Please | ||
on: | ||
push: | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
name: Test | ||
|
||
on: | ||
|
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
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,45 @@ | ||
#include "../../source/window_actions.h" | ||
#include "../support/base_test.h" | ||
#include "../support/test_tools.h" | ||
#include "../support/test_window.h" | ||
#include "gtest/gtest.h" | ||
#include <memory> | ||
|
||
namespace window_tool::tests { | ||
class ActionMinimizeWindow : public base_test { | ||
|
||
}; | ||
|
||
TEST_F(ActionMinimizeWindow, WithWindow) { | ||
// Arrange | ||
const std::wstring window_title = tools::random_string(L"Test Window "); | ||
std::vector<std::wstring> arguments = { default_app_name, window_title, L"minimize" }; | ||
window_tool::window_actions actions(arguments); | ||
|
||
auto win = std::unique_ptr<test_window>(test_window::create(window_title, true)); | ||
|
||
// Act | ||
int result = actions.run(); | ||
std::wstring output_str = captured_out.str(); | ||
|
||
// Assert | ||
EXPECT_TRUE(win->was_minimized()); | ||
EXPECT_EQ(tools::trim(output_str), L"True"); | ||
EXPECT_EQ(result, 0); | ||
} | ||
|
||
TEST_F(ActionMinimizeWindow, WithoutWindow) { | ||
// Arrange | ||
const std::wstring window_title = tools::random_string(L"Test Window "); | ||
std::vector<std::wstring> arguments = { default_app_name, window_title, L"minimize" }; | ||
window_tool::window_actions actions(arguments); | ||
|
||
// Act | ||
int result = actions.run(); | ||
std::wstring output_str = captured_out.str(); | ||
|
||
// Assert | ||
EXPECT_EQ(tools::trim(output_str), L"False"); | ||
EXPECT_EQ(result, 0); | ||
} | ||
} |
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
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