From 4ec6a2ae12b6adb843c0777649ff45a741ca6cbc Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 23 Jul 2024 15:08:19 +0200 Subject: domain: redesign turn_order --- domain/tests/participant.cpp | 90 ++++++++------------------------------------ 1 file changed, 15 insertions(+), 75 deletions(-) (limited to 'domain/tests/participant.cpp') diff --git a/domain/tests/participant.cpp b/domain/tests/participant.cpp index dd244f4..e4e185c 100644 --- a/domain/tests/participant.cpp +++ b/domain/tests/participant.cpp @@ -22,123 +22,63 @@ namespace turns::domain::tests REQUIRE(participant::create(constructed_name, constructed_priority, constructed_disposition)); } - SECTION("allows access to its disposition via the associated accessors") + SECTION("allows access to its disposition") { SECTION("allowing to get it") { - REQUIRE(instance.get_disposition() == constructed_disposition); + REQUIRE(instance.disposition() == constructed_disposition); } SECTION("allowing to get it via a constant object") { auto const & cref = instance; - REQUIRE(cref.get_disposition() == constructed_disposition); + REQUIRE(cref.disposition() == constructed_disposition); } SECTION("allowing to set it") { - instance.set_disposition(disposition::hostile); - REQUIRE(instance.get_disposition() == disposition::hostile); + instance.disposition() = disposition::hostile; + REQUIRE(instance.disposition() == disposition::hostile); } } - SECTION("allows access to its disposition via the associated property") + SECTION("allows access to its name") { SECTION("allowing to get it") { - REQUIRE(instance.property_disposition() == constructed_disposition); + REQUIRE(instance.name() == constructed_name); } SECTION("allowing to get it via a constant object") { auto const & cref = instance; - REQUIRE(cref.property_disposition() == constructed_disposition); + REQUIRE(cref.name() == constructed_name); } SECTION("allowing to set it") { - instance.property_disposition() = disposition::hostile; - REQUIRE(instance.get_disposition() == disposition::hostile); + instance.name() = "replaced"; + REQUIRE(instance.name() == "replaced"); } } - SECTION("allows access to its name via the associated accessors") + SECTION("allows access to its priority") { SECTION("allowing to get it") { - REQUIRE(instance.get_name() == constructed_name); + REQUIRE(instance.priority() == constructed_priority); } SECTION("allowing to get it via a constant object") { auto const & cref = instance; - REQUIRE(cref.get_name() == constructed_name); + REQUIRE(cref.priority() == constructed_priority); } SECTION("allowing to set it") { - instance.set_name("replaced"); - REQUIRE(instance.get_name() == "replaced"); - } - } - - SECTION("allows access to its name via the associated property") - { - SECTION("allowing to get it") - { - REQUIRE(instance.property_name() == constructed_name); - } - - SECTION("allowing to get it via a constant object") - { - auto const & cref = instance; - REQUIRE(cref.property_name() == constructed_name); - } - - SECTION("allowing to set it") - { - instance.property_name() = "replaced"; - REQUIRE(instance.get_name() == "replaced"); - } - } - - SECTION("allows access to its priority via the associated accessors") - { - SECTION("allowing to get it") - { - REQUIRE(instance.get_priority() == constructed_priority); - } - - SECTION("allowing to get it via a constant object") - { - auto const & cref = instance; - REQUIRE(cref.get_priority() == constructed_priority); - } - - SECTION("allowing to set it") - { - instance.set_priority(3); - REQUIRE(instance.get_priority() == 3); - } - } - - SECTION("allows access to its priority via the associated property") - { - SECTION("allowing to get it") - { - REQUIRE(instance.property_priority() == constructed_priority); - } - - SECTION("allowing to get it via a constant object") - { - auto const & cref = instance; - REQUIRE(cref.property_priority() == constructed_priority); - } - - SECTION("allowing to set it") - { - instance.property_priority() = 4; - REQUIRE(instance.get_priority() == 4); + instance.priority() = 4; + REQUIRE(instance.priority() == 4); } } -- cgit v1.2.3