diff options
Diffstat (limited to 'ui/tests')
| -rw-r--r-- | ui/tests/participant_editor.cpp | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/ui/tests/participant_editor.cpp b/ui/tests/participant_editor.cpp index 0d2ab13..b2398de 100644 --- a/ui/tests/participant_editor.cpp +++ b/ui/tests/participant_editor.cpp @@ -31,6 +31,7 @@ namespace turns::ui::tests 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<ParticipantEditor>(nullptr); auto window = Gtk::Window{}; @@ -59,6 +60,47 @@ namespace turns::ui::tests 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()); @@ -105,4 +147,4 @@ namespace turns::ui::tests } } -} // namespace turns::ui::widgets::tests
\ No newline at end of file +} // namespace turns::ui::tests
\ No newline at end of file |
