23 #include "gtest/gtest.h"
33 TEST(TestGroup, memberships)
35 auto user = std::make_shared<User>(
"toto");
36 auto group = std::make_shared<Group>(
"my_group");
39 auto members = g->members();
40 for (
const auto &member : members)
42 if (member->username() == u->username())
47 ASSERT_FALSE(in_grp(user, group));
48 group->member_add(user);
49 ASSERT_TRUE(in_grp(user, group));
52 TEST(TestGroupValidator, name_length)
59 g.
name(
"long_enough");
64 { g.
name(
"this_is_so_long_this_name_is_clearly_to_long_to_be_valid"); },
68 TEST(TestGroupValidator, name_invalid_char)
71 ASSERT_NO_THROW({ g.
name(
"aaaa"); });