Skip to content

Commit

Permalink
test: Add and fix tests
Browse files Browse the repository at this point in the history
Some tests added to the AgentRegistration class, and others fixed
due to previous changes.
  • Loading branch information
sdvendramini committed Oct 30, 2024
1 parent 4d0febb commit 8949276
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/agent/agent_info/tests/agent_info_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,15 @@ TEST_F(AgentInfoTest, TestDefaultConstructorDefaultValues)
EXPECT_NE(agentInfo.GetUUID(), "");
}

TEST_F(AgentInfoTest, TestParameterizedConstructor)
{
const std::string name = "new_name";
const std::string key = "new_key";
const std::string uuid = "new_uuid";

const AgentInfo agentInfo(name, key, uuid);
EXPECT_EQ(agentInfo.GetName(), name);
EXPECT_EQ(agentInfo.GetKey(), key);
EXPECT_EQ(agentInfo.GetUUID(), uuid);
}

TEST_F(AgentInfoTest, TestPersistedValues)
{
const AgentInfo agentInfo("test_name", "test_key", "test_uuid");
AgentInfo agentInfo;
agentInfo.SetName("test_name");
agentInfo.SetKey("4GhT7uFm1zQa9c2Vb7Lk8pYsX0WqZrNj");
agentInfo.SetUUID("test_uuid");
const AgentInfo agentInfoReloaded;
EXPECT_EQ(agentInfoReloaded.GetName(), "test_name");
EXPECT_EQ(agentInfoReloaded.GetKey(), "test_key");
EXPECT_EQ(agentInfoReloaded.GetKey(), "4GhT7uFm1zQa9c2Vb7Lk8pYsX0WqZrNj");
EXPECT_EQ(agentInfoReloaded.GetUUID(), "test_uuid");
}

Expand Down

0 comments on commit 8949276

Please sign in to comment.