From 5d8f799a1171f92054d4b45ba130cd7fdad0bd01 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 23 May 2025 14:04:27 +0200 Subject: app: prepare restructuring --- ui/tests/participant_editor.cpp | 150 ---------------------------------------- 1 file changed, 150 deletions(-) delete mode 100644 ui/tests/participant_editor.cpp (limited to 'ui/tests/participant_editor.cpp') diff --git a/ui/tests/participant_editor.cpp b/ui/tests/participant_editor.cpp deleted file mode 100644 index fee0313..0000000 --- a/ui/tests/participant_editor.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#include "turns/ui/participant_editor.hpp" - -#include "turns/core/disposition.hpp" -#include "turns/core/participant.hpp" -#include "turns/lang/messages.hpp" - -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include -#include - -namespace turns::ui::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 participant = core::Participant::create("Frederick Thumblewackle", 7.2, core::Disposition::Friendly); - auto instance = std::make_shared(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("has neutral disposition") - { - REQUIRE(instance->get_disposition() == core::Disposition::Neutral); - } - - SECTION("has a null participant") - { - REQUIRE_FALSE(instance->get_participant()); - } - - WHEN("setting a new participant") - { - instance->set_participant(participant); - - THEN("getting the participant returns the new one") - { - REQUIRE(instance->get_participant() == participant); - } - - THEN("changes to the name propagate to the participant") - { - CHECK(participant->get_name() != "REPLACED"); - instance->set_name("REPLACED"); - REQUIRE(participant->get_name() == "REPLACED"); - } - - THEN("changes to the priority propagate to the participant") - { - CHECK(participant->get_priority() != 0); - instance->set_priority(0); - REQUIRE(participant->get_priority() == 0); - } - - THEN("changes to the disposition propagate to the participant") - { - CHECK(participant->get_disposition() != core::Disposition::Secret); - instance->set_disposition(core::Disposition::Secret); - REQUIRE(participant->get_disposition() == core::Disposition::Secret); - } - } - - 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(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::tests \ No newline at end of file -- cgit v1.2.3