summaryrefslogtreecommitdiff
path: root/domain/tests/participant.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-12 11:49:09 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-12 11:49:09 +0200
commit61ba5c151040533f23642c07fc2230a5718396ee (patch)
tree3bc6487afdedbfdb7ad5454bd93727de0c5ee247 /domain/tests/participant.cpp
parent6ea55ee85b15e1c6eea25d78881435b1d6f960cd (diff)
downloadturns-61ba5c151040533f23642c07fc2230a5718396ee.tar.xz
turns-61ba5c151040533f23642c07fc2230a5718396ee.zip
domain: add basic participant
Diffstat (limited to 'domain/tests/participant.cpp')
-rw-r--r--domain/tests/participant.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/domain/tests/participant.cpp b/domain/tests/participant.cpp
new file mode 100644
index 0000000..7220209
--- /dev/null
+++ b/domain/tests/participant.cpp
@@ -0,0 +1,43 @@
+#include "turns/domain/participant.hpp"
+
+#include <catch2/catch_test_macros.hpp>
+
+namespace turns::domain::tests
+{
+
+ TEST_CASE("A participant")
+ {
+
+ auto constexpr constructed_name = "Vana Thistletop";
+ auto constexpr constructed_order = 17;
+ auto instance = participant::create(constructed_name, constructed_order);
+
+ SECTION("can be created")
+ {
+ REQUIRE(instance);
+ }
+
+ SECTION("the name can be read")
+ {
+ REQUIRE(instance->name() == constructed_name);
+ }
+
+ SECTION("the name can be changed")
+ {
+ instance->name("replaced");
+ REQUIRE(instance->name() == "replaced");
+ }
+
+ SECTION("the order can be read")
+ {
+ REQUIRE(instance->order() == constructed_order);
+ }
+
+ SECTION("the order can be changed")
+ {
+ instance->order(8);
+ REQUIRE(instance->order() == 8);
+ }
+ }
+
+} // namespace turns::domain::tests \ No newline at end of file