Skip to content

Commit 1aafdda

Browse files
committed
test: add a test to check the delete in the SetGroups method
1 parent 9ee8ae7 commit 1aafdda

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/agent/agent_info/tests/agent_info_persistance_test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ TEST_F(AgentInfoPersistanceTest, TestSetGroups)
5757
EXPECT_EQ(persistance->GetGroups(), newGroups);
5858
}
5959

60+
TEST_F(AgentInfoPersistanceTest, TestSetGroupsDelete)
61+
{
62+
const std::vector<std::string> oldGroups = {"group_1", "group_2"};
63+
const std::vector<std::string> newGroups = {"group_3", "group_4"};
64+
persistance->SetGroups(oldGroups);
65+
EXPECT_EQ(persistance->GetGroups(), oldGroups);
66+
persistance->SetGroups(newGroups);
67+
EXPECT_EQ(persistance->GetGroups(), newGroups);
68+
}
69+
6070
TEST_F(AgentInfoPersistanceTest, TestResetToDefault)
6171
{
6272
const std::string newName = "new_name";

0 commit comments

Comments
 (0)