diff options
Diffstat (limited to 'domain/tests/participant.cpp')
| -rw-r--r-- | domain/tests/participant.cpp | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/domain/tests/participant.cpp b/domain/tests/participant.cpp index 6db98f7..dd244f4 100644 --- a/domain/tests/participant.cpp +++ b/domain/tests/participant.cpp @@ -1,4 +1,5 @@ #include "turns/domain/participant.hpp" +#include "turns/domain/disposition.hpp" #include <catch2/catch_test_macros.hpp> @@ -13,11 +14,52 @@ namespace turns::domain::tests { auto constexpr constructed_name = "Vana Thistletop"; auto constexpr constructed_priority = 17; - auto instance = participant{constructed_name, constructed_priority}; + auto constexpr constructed_disposition = disposition::friendly; + auto instance = participant{constructed_name, constructed_priority, constructed_disposition}; SECTION("can be created") { - REQUIRE(participant::create(constructed_name, constructed_priority)); + REQUIRE(participant::create(constructed_name, constructed_priority, constructed_disposition)); + } + + SECTION("allows access to its disposition via the associated accessors") + { + SECTION("allowing to get it") + { + REQUIRE(instance.get_disposition() == constructed_disposition); + } + + SECTION("allowing to get it via a constant object") + { + auto const & cref = instance; + REQUIRE(cref.get_disposition() == constructed_disposition); + } + + SECTION("allowing to set it") + { + instance.set_disposition(disposition::hostile); + REQUIRE(instance.get_disposition() == disposition::hostile); + } + } + + SECTION("allows access to its disposition via the associated property") + { + SECTION("allowing to get it") + { + REQUIRE(instance.property_disposition() == constructed_disposition); + } + + SECTION("allowing to get it via a constant object") + { + auto const & cref = instance; + REQUIRE(cref.property_disposition() == constructed_disposition); + } + + SECTION("allowing to set it") + { + instance.property_disposition() = disposition::hostile; + REQUIRE(instance.get_disposition() == disposition::hostile); + } } SECTION("allows access to its name via the associated accessors") @@ -102,9 +144,9 @@ namespace turns::domain::tests SECTION("can be compared with another participant") { - auto equivalent_instance = participant{"Equivalent", constructed_priority}; - auto lesser_instance = participant{"Lesser", constructed_priority - 1}; - auto greater_instance = participant{"Greater", constructed_priority + 1}; + auto equivalent_instance = participant{"Equivalent", constructed_priority, constructed_disposition}; + auto lesser_instance = participant{"Lesser", constructed_priority - 1, constructed_disposition}; + auto greater_instance = participant{"Greater", constructed_priority + 1, constructed_disposition}; SECTION("yielding std::partial_ordering::equivalent for itself") { |
