#include "turns-turn-order.h" #include "turns-participant.h" #include #include #include SCENARIO("Creating a turn order", "[lib][object][lifetime]") { GIVEN("A turn order constructed using turns_turn_order_new()") { g_autoptr(TurnsTurnOrder) instance = turns_turn_order_new(); THEN("it's participant count is 0") { REQUIRE(turns_turn_order_get_participant_count(instance) == 0uz); auto property_value = decltype(turns_turn_order_get_participant_count(instance)){}; g_object_get(instance, "participant-count", &property_value, nullptr); REQUIRE(property_value == 0); } THEN("it's running state is false") { REQUIRE_FALSE(turns_turn_order_get_running(instance)); auto property_value = decltype(turns_turn_order_get_participant_count(instance)){}; g_object_get(instance, "running", &property_value, nullptr); REQUIRE_FALSE(property_value); } THEN("it's item count is 0") { REQUIRE(g_list_model_get_n_items(G_LIST_MODEL(instance)) == 0); } THEN("it's item type is Turns.Participant") { REQUIRE(g_list_model_get_item_type(G_LIST_MODEL(instance)) == turns_participant_get_type()); } THEN("it's first item is NULL") { REQUIRE(g_list_model_get_item(G_LIST_MODEL(instance), 0) == nullptr); REQUIRE(g_list_model_get_object(G_LIST_MODEL(instance), 0) == nullptr); } } }