Skip to content

Commit

Permalink
test: internet module testcase added
Browse files Browse the repository at this point in the history
* test case added to internet module for code coverage

Signed-off-by: Guru Mehar Rachaputi <[email protected]>
  • Loading branch information
00thirdeye00 committed Jul 22, 2024
1 parent 92c0404 commit 57ec1ac
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/modules/internet_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ TEST_F(InternetTest, shouldGenerateEmoji)
{ return generatedEmoji == emoji; }));
}

TEST_F(InternetTest, shouldCheckEmoji)
{
const auto checkEmoji = "❤️";

ASSERT_TRUE(checkIfEmojiIsValid(checkEmoji));
}

TEST_F(InternetTest, shouldGenerateSmileyEmoji)
{
const auto generatedEmoji = emoji(EmojiType::Smiley);
Expand Down Expand Up @@ -677,6 +684,23 @@ TEST_F(InternetTest, MacDefaultSeparator)
}
}

TEST_F(InternetTest, MacDefaultSeparatorOverwrite)
{
const auto generatedMac = mac(";");

ASSERT_EQ(generatedMac.size(), 17);

for (size_t i = 0; i < generatedMac.size(); i += 3)
{
ASSERT_TRUE(isxdigit(generatedMac[i]));
}

for (size_t i = 2; i < generatedMac.size(); i += 3)
{
ASSERT_EQ(generatedMac[i], ':');
}
}

TEST_F(InternetTest, shouldGenerateDomainSuffix)
{
const auto generatedDomainSuffix = domainSuffix();
Expand Down

0 comments on commit 57ec1ac

Please sign in to comment.