diff --git a/src/modules/helper/HelperTest.cpp b/src/modules/helper/HelperTest.cpp index b58053a1c..864200358 100644 --- a/src/modules/helper/HelperTest.cpp +++ b/src/modules/helper/HelperTest.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "gtest/gtest.h" @@ -18,6 +19,24 @@ class HelperTest : public Test namespace { +TEST_F(HelperTest, SetElement) +{ + std::set chars{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'l', 'm'}; + std::vector randomChars; + for (int i = 0; i < 30; ++i) + { + randomChars.push_back(Helper::setElement(chars)); + } + for (auto character : randomChars) + { + ASSERT_TRUE(chars.find(character) != chars.end()); + } +} +TEST_F(HelperTest, SetElementEmptyData) +{ + std::set chars{}; + ASSERT_THROW(Helper::setElement(chars), std::invalid_argument); +} TEST_F(HelperTest, ReplaceSymbolWithNumber) { std::string input = "123#456!";