ui::testing::TestJumpListHost¶
Header: winui/testing/TestJumpListHost.hpp.
Derives from ui::JumpListHost.
JumpListHost test double: touches no jump list, and keeps the tasks it was handed and every recent file.
Install it with set_jump_list_host(); ui::set_jump_list() and ui::add_recent_file() then reach it. It uninstalls itself when destroyed.
Example:
ui::testing::TestJumpListHost jump_list;
ui::testing::set_jump_list_host(&jump_list);
ui::set_jump_list({ui::JumpTask{.title = "New window", .arguments = "--new-window"}});
ui::add_recent_file("notes.txt");
REQUIRE(jump_list.tasks.size() == 1);
REQUIRE(jump_list.recent_files.size() == 1);
tasks¶
The tasks of the last ui::set_jump_list().
recent_files¶
Every file ui::add_recent_file() was given, oldest first.
set_count¶
How many times ui::set_jump_list() was called.
TestJumpListHost¶
~TestJumpListHost¶
Uninstalls it if it is still the installed host.
TestJumpListHost¶
operator=¶
set_tasks¶
Replaces tasks and counts the call.
add_recent_file¶
Appends path to recent_files.