blob: ed9d586c8c9220ad72da0c5f2e6a20bd33ac581a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#include "turnsmm/turn-order.hpp"
#include "turnsmm/participant.hpp"
#include <catch2/catch_test_macros.hpp>
#include <cstddef>
SCENARIO("Creating a turn order", "[lib][object][lifetime]")
{
GIVEN("A turn order constructed using the default constructor")
{
auto instance = Turns::TurnOrder{};
THEN("it's participant count is 0")
{
REQUIRE(instance.get_participant_count() == 0uz);
REQUIRE(instance.get_property<std::size_t>("participant-count") == 0);
}
THEN("it's running state is false")
{
REQUIRE_FALSE(instance.get_running());
REQUIRE_FALSE(instance.get_property<std::size_t>("running"));
}
THEN("it's item count is 0")
{
REQUIRE(instance.get_n_items() == 0);
}
THEN("it's item type is Turns.Participant")
{
REQUIRE(instance.get_item_type() == Turns::Participant::get_type());
}
THEN("it's first item is NULL")
{
REQUIRE(instance.get_object(0) == nullptr);
REQUIRE(instance.get_typed_object<Turns::Participant>(0) == nullptr);
}
}
}
|