diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-29 16:33:32 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-29 16:33:32 +0200 |
| commit | 3ff5bd46952144926d9bd9beedf50023a51913ee (patch) | |
| tree | 2c579fe13bbb5cc90f8f50e7af35218c98e123d5 /ui/tests/widgets | |
| parent | 873bf396b904ce477a238f22d1891e1b03f24eff (diff) | |
| download | turns-3ff5bd46952144926d9bd9beedf50023a51913ee.tar.xz turns-3ff5bd46952144926d9bd9beedf50023a51913ee.zip | |
ui: flatten namespace hierarchy
Diffstat (limited to 'ui/tests/widgets')
| -rw-r--r-- | ui/tests/widgets/participant_editor.cpp | 108 | ||||
| -rw-r--r-- | ui/tests/widgets/participant_row.cpp | 30 |
2 files changed, 0 insertions, 138 deletions
diff --git a/ui/tests/widgets/participant_editor.cpp b/ui/tests/widgets/participant_editor.cpp deleted file mode 100644 index 41ba5bd..0000000 --- a/ui/tests/widgets/participant_editor.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include "turns/ui/widgets/participant_editor.hpp" - -#include "turns/core/disposition.hpp" -#include "turns/core/participant.hpp" -#include "turns/lang/messages.hpp" - -#include <catch2/catch_test_macros.hpp> -#include <catch2/generators/catch_generators.hpp> - -#include <glibmm/i18n.h> -#include <glibmm/ustring.h> -#include <glibmm/wrap.h> - -#include <gtkmm/builder.h> -#include <gtkmm/listboxrow.h> -#include <gtkmm/window.h> - -#include <adwaitamm/entryrow.hpp> -#include <adwaitamm/spinrow.hpp> - -#include <gtk/gtk.h> - -#include <clocale> -#include <memory> - -namespace turns::ui::widgets::tests -{ - - TEST_CASE("A freshly constructed participant editor without a participant", "[windows]") - { - auto locale = GENERATE("en_US.UTF-8", "de_CH.UTF-8"); - setlocale(LC_ALL, locale); - - auto instance = std::make_shared<ParticipantEditor>(nullptr); - auto window = Gtk::Window{}; - - SECTION("was successfully constructed") - { - REQUIRE(instance); - } - - SECTION("has a non-empty title") - { - REQUIRE_FALSE(instance->get_title().empty()); - } - - SECTION("has its title set according to the active language") - { - REQUIRE(instance->get_title() == _(lang::add_participant)); - } - - SECTION("has an empty name") - { - REQUIRE(instance->get_name().empty()); - } - - SECTION("has a zero priority") - { - REQUIRE(instance->get_priority() == 0); - } - - SECTION("allows binding to the finished signal") - { - REQUIRE((instance->signal_finished().connect([](auto, auto, auto) {})).connected()); - } - } - - TEST_CASE("A freshly constructed participant editor with a participant", "[windows]") - { - auto locale = GENERATE("en_US.UTF-8", "de_CH.UTF-8"); - setlocale(LC_ALL, locale); - - auto participant = core::participant::create("Qibi Babblebranch", 12, core::disposition::neutral); - auto instance = std::make_shared<ParticipantEditor>(participant); - auto window = Gtk::Window{}; - - SECTION("was successfully constructed") - { - REQUIRE(instance); - } - - SECTION("has a non-empty title") - { - REQUIRE_FALSE(instance->get_title().empty()); - } - - SECTION("has its title set according to the active language") - { - REQUIRE(instance->get_title() == _(lang::edit_participant)); - } - - SECTION("has its name field set according to its participant") - { - REQUIRE(instance->get_name() == participant->property_name().get_value()); - } - - SECTION("has its priority field set according to its participant") - { - REQUIRE(instance->get_priority() == participant->property_priority()); - } - - SECTION("allows binding to the finished signal") - { - REQUIRE((instance->signal_finished().connect([](auto, auto, auto) {})).connected()); - } - } - -} // namespace turns::ui::widgets::tests
\ No newline at end of file diff --git a/ui/tests/widgets/participant_row.cpp b/ui/tests/widgets/participant_row.cpp deleted file mode 100644 index 491dcc8..0000000 --- a/ui/tests/widgets/participant_row.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "turns/ui/widgets/participant_row.hpp" - -#include "turns/core/disposition.hpp" -#include "turns/core/participant.hpp" - -#include <catch2/catch_test_macros.hpp> - -#include <glibmm/refptr.h> - -#include <gtkmm/object.h> - -#include <memory> - -namespace turns::ui::widgets::tests -{ - - TEST_CASE("A freshly constructed participant row") - { - SECTION("can be created without a participant") - { - REQUIRE(std::make_shared<participant_row>(Glib::RefPtr<core::participant>{})); - } - - SECTION("can be created with a participant") - { - REQUIRE(std::make_shared<participant_row>(core::participant::create("Tazmyla Fireforge", 13, core::disposition::secret))); - } - } - -} // namespace turns::ui::widgets::tests
\ No newline at end of file |
