소스 검색

Merge branch 'remove-utils-package' of public/ls-standard-library into development

patrick-christopher.mattulat 1 년 전
부모
커밋
d609049e0b

+ 0 - 3
CMakeLists.txt

@@ -163,7 +163,6 @@ set(SOURCE_FILES_CORE
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/ISerializable.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IStorable.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IWriter.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/utils/RegexUtils.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Class.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/LibraryVersion.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Version.cpp)
@@ -232,8 +231,6 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArithmeticOperationExceptionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IncompleteJsonExceptionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/NullPointerExceptionTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/utils/RegexUtilsTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/utils/StlUtilsTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ClassTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/LibraryVersionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/VersionTest.cpp

+ 2 - 1
README.md

@@ -38,7 +38,8 @@ A __Date__ class comes with this submodule, which you can use to represent a dat
 
 #### Improvements ####
 
-- __logic__ module has been removed from library and can now be found in __ls-game-tool-kit__ library
+- __logic__ module has been removed from this library and can now be found in __ls-game-tool-kit__ library
+- __core.utils__ module has been removed from this library to provide more clean implementations where it's needed
 - namespaces have been completely removed from module tests to improve readability
 - a new naming convention for files and directories has been introduced, where underscores were replaced by dashes entirely
 - fetching the library version can now be achieved by using a dedicated __LibraryVersion__ class - the usage of a static function for this purpose has been removed completely

+ 0 - 29
include/ls-std/core/utils/RegexUtils.hpp

@@ -1,29 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-18
- * Changed:         2023-02-05
- *
- * */
-
-#ifndef LS_STD_REGEX_UTILS_HPP
-#define LS_STD_REGEX_UTILS_HPP
-
-#include <ls-std/os/dynamic-goal.hpp>
-#include <string>
-
-namespace ls::std::core
-{
-  class LS_STD_DYNAMIC_GOAL RegexUtils
-  {
-    public:
-
-      RegexUtils();
-      ~RegexUtils();
-
-      static ::std::string escapeString(const ::std::string &_text);
-  };
-}
-
-#endif

+ 0 - 56
include/ls-std/core/utils/StlUtils.hpp

@@ -1,56 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-17
- * Changed:         2023-02-04
- *
- * */
-
-#ifndef LS_STD_STL_UTILS_HPP
-#define LS_STD_STL_UTILS_HPP
-
-#include <algorithm>
-#include <list>
-
-namespace ls::std::core
-{
-  class StlUtils // TODO: remove this class entirely
-  {
-    public:
-
-      StlUtils() = default;
-      ~StlUtils() = default;
-
-      template<class container, class dataType>
-      static bool contains(container _container, const dataType &_value)
-      {
-        return ::std::find(_container.begin(), _container.end(), _value) != _container.end();
-      }
-
-      template<class dataType>
-      static dataType getListElementAt(const ::std::list<dataType> &_list, size_t _index)
-      {
-        dataType value{};
-        size_t counter{};
-
-        if (_index < _list.size())
-        {
-          for (const auto &_value: _list)
-          {
-            if (counter == _index)
-            {
-              value = _value;
-              break;
-            }
-
-            counter++;
-          }
-        }
-
-        return value;
-      }
-  };
-}
-
-#endif

+ 0 - 36
include/ls-std/core/utils/WindowsUtils.hpp

@@ -1,36 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-12-06
- * Changed:         2023-02-04
- *
- * */
-
-#ifndef LS_STD_WINDOWS_UTILS_HPP
-#define LS_STD_WINDOWS_UTILS_HPP
-
-#include <ls-std/core/types/Types.hpp>
-#include <string>
-#include <windows.h>
-
-namespace ls::std::core
-{
-  class WindowsUtils // TODO: migrate to header / source split approach
-  {
-    public:
-
-      WindowsUtils() = default;
-      ~WindowsUtils() = default;
-
-      static ::std::string getMessageFromErrorCode(const int &_errorCode)
-      {
-        ls::std::core::type::byte messageBuffer[256 + 1];
-        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, _errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), messageBuffer, sizeof(messageBuffer), nullptr);
-
-        return ::std::string{messageBuffer};
-      }
-  };
-}
-
-#endif

+ 3 - 1
include/ls-std/event/Narrator.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -34,6 +34,8 @@ namespace ls::std::event
     private:
 
       ::std::list<::std::shared_ptr<ls::std::core::interface_type::IListener>> listeners{};
+
+      bool _hasListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener);
   };
 }
 

+ 1 - 7
include/ls-std/ls-std-core.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2022-05-13
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -32,12 +32,6 @@
 #include <ls-std/core/types/KvTypes.hpp>
 #include <ls-std/core/types/Types.hpp>
 
-#include <ls-std/core/utils/RegexUtils.hpp>
-#include <ls-std/core/utils/StlUtils.hpp>
-#if _WIN32
-  #include <ls-std/core/utils/WindowsUtils.hpp>
-#endif
-
 #include <ls-std/core/Class.hpp>
 #include <ls-std/core/LibraryVersion.hpp>
 #include <ls-std/core/Version.hpp>

+ 0 - 21
source/ls-std/core/utils/RegexUtils.cpp

@@ -1,21 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2023-02-04
- * Changed:         2023-02-04
- *
- * */
-
-#include <ls-std/core/utils/RegexUtils.hpp>
-#include <regex>
-
-ls::std::core::RegexUtils::RegexUtils() = default;
-
-ls::std::core::RegexUtils::~RegexUtils() = default;
-
-::std::string ls::std::core::RegexUtils::escapeString(const ::std::string &_text)
-{
-  static ::std::regex regexMetaEscape(R"(([\^\$\\\.\*\+\?\(\)\[\]\{\}\|]))");
-  return ::std::regex_replace(_text, regexMetaEscape, R"(\$1)");
-}

+ 9 - 4
source/ls-std/event/Narrator.cpp

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
+#include <algorithm>
 #include <ls-std/core/exception/IllegalArgumentException.hpp>
-#include <ls-std/core/utils/StlUtils.hpp>
 #include <ls-std/event/Narrator.hpp>
 
 ls::std::event::Narrator::Narrator() : ls::std::core::Class("Narrator")
@@ -26,7 +26,7 @@ bool ls::std::event::Narrator::addListener(const ::std::shared_ptr<ls::std::core
   }
   else
   {
-    if (!ls::std::core::StlUtils::contains(this->listeners, _listener))
+    if (!this->_hasListener(_listener))
     {
       this->listeners.push_back(_listener);
       wasAdded = true;
@@ -56,7 +56,7 @@ bool ls::std::event::Narrator::removeListener(const ::std::shared_ptr<ls::std::c
   }
   else
   {
-    if (ls::std::core::StlUtils::contains(this->listeners, _listener))
+    if (this->_hasListener(_listener))
     {
       this->listeners.remove(_listener);
       wasRemoved = true;
@@ -73,3 +73,8 @@ void ls::std::event::Narrator::tell(const ls::std::core::Class &_info)
     listener->listen(_info);
   }
 }
+
+bool ls::std::event::Narrator::_hasListener(const ::std::shared_ptr<ls::std::core::interface_type::IListener> &_listener)
+{
+  return ::std::find(this->listeners.begin(), this->listeners.end(), _listener) != this->listeners.end();
+}

+ 3 - 3
source/ls-std/io/xml/XmlNode.cpp

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-24
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
+#include <algorithm>
 #include <ls-std/core/exception/IllegalArgumentException.hpp>
-#include <ls-std/core/utils/StlUtils.hpp>
 #include <ls-std/io/xml/XmlNode.hpp>
 
 ls::std::io::XmlNode::XmlNode(::std::string _name) : ls::std::core::Class("XmlNode"), name(::std::move(_name))
@@ -390,7 +390,7 @@ bool ls::std::io::XmlNode::_hasAttribute(const ::std::string &_name)
 bool ls::std::io::XmlNode::_hasChild(const ::std::shared_ptr<ls::std::io::XmlNode> &_child)
 {
   _checkIfNodeReferenceIsValid(_child);
-  return ls::std::core::StlUtils::contains(this->children, _child);
+  return ::std::find(this->children.begin(), this->children.end(), _child) != this->children.end();
 }
 
 bool ls::std::io::XmlNode::_hasChild(const ::std::string &_name)

+ 0 - 40
test/cases/core/utils/RegexUtilsTest.cpp

@@ -1,40 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-18
- * Changed:         2023-02-03
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls-std/ls-std-core.hpp>
-
-using namespace ls::std::core;
-using namespace ::std;
-
-namespace
-{
-  class RegexUtilsTest : public ::testing::Test
-  {
-    protected:
-
-      RegexUtilsTest() = default;
-      ~RegexUtilsTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(RegexUtilsTest, escapeString)
-  {
-    string escapedString = RegexUtils::escapeString("Hello?!");
-    ASSERT_STREQ(R"(Hello\?!)", escapedString.c_str());
-
-    escapedString = RegexUtils::escapeString(R"(\)");
-    ASSERT_STREQ(R"(\\)", escapedString.c_str());
-  }
-}

+ 0 - 85
test/cases/core/utils/StlUtilsTest.cpp

@@ -1,85 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-17
- * Changed:         2023-02-03
- *
- * */
-
-#include <gtest/gtest.h>
-#include <list>
-#include <ls-std/ls-std-core.hpp>
-#include <string>
-#include <vector>
-
-using namespace ls::std::core;
-using namespace ::std;
-
-namespace
-{
-  class StlUtilsTest : public ::testing::Test
-  {
-    protected:
-
-      StlUtilsTest() = default;
-      ~StlUtilsTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(StlUtilsTest, contains)
-  {
-    vector<int> values{1, 13, 7, 8};
-    list<string> names{"Tim", "Alex", "Nadine"};
-
-    ASSERT_TRUE((StlUtils::contains(values, 1)));
-    ASSERT_TRUE((StlUtils::contains(values, 13)));
-    ASSERT_TRUE((StlUtils::contains(values, 7)));
-    ASSERT_TRUE((StlUtils::contains(values, 8)));
-
-    ASSERT_TRUE((StlUtils::contains(names, "Tim")));
-    ASSERT_TRUE((StlUtils::contains(names, "Alex")));
-    ASSERT_TRUE((StlUtils::contains(names, "Nadine")));
-  }
-
-  TEST_F(StlUtilsTest, containsNegative)
-  {
-    vector<int> values{1, 13, 7, 8};
-    list<string> names{"Tim", "Alex", "Nadine"};
-
-    ASSERT_FALSE((StlUtils::contains(values, 55)));
-    ASSERT_FALSE((StlUtils::contains(values, 9)));
-
-    ASSERT_FALSE((StlUtils::contains(names, "Lena")));
-    ASSERT_FALSE((StlUtils::contains(names, "Mirco")));
-  }
-
-  TEST_F(StlUtilsTest, getListElementAt)
-  {
-    list<int> values{1, 13, 7, 8};
-    list<string> names{"Tim", "Alex", "Nadine"};
-
-    ASSERT_EQ(1, (StlUtils::getListElementAt(values, 0)));
-    ASSERT_EQ(13, (StlUtils::getListElementAt(values, 1)));
-    ASSERT_EQ(7, (StlUtils::getListElementAt(values, 2)));
-    ASSERT_EQ(8, (StlUtils::getListElementAt(values, 3)));
-
-    ASSERT_STREQ("Tim", StlUtils::getListElementAt(names, 0).c_str());
-    ASSERT_STREQ("Alex", StlUtils::getListElementAt(names, 1).c_str());
-    ASSERT_STREQ("Nadine", StlUtils::getListElementAt(names, 2).c_str());
-  }
-
-  TEST_F(StlUtilsTest, getListElementAtNegative)
-  {
-    list<int> values{1, 13, 7, 8};
-    list<string> names{"Tim", "Alex", "Nadine"};
-
-    ASSERT_EQ(0, (StlUtils::getListElementAt(values, 15)));
-    ASSERT_STREQ("", StlUtils::getListElementAt(names, 15).c_str());
-  }
-}

+ 4 - 4
test/cases/io/FileOutputStreamTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -35,7 +35,7 @@ namespace
 
   TEST_F(FileOutputStreamTest, constructor_file_does_not_exist)
   {
-    string path = TestHelper::getResourcesFolderLocation() + "not_existing.txt";
+    string path = TestHelper::getResourcesFolderLocation() + "not-existing.txt";
     File file{path};
 
     EXPECT_THROW(
@@ -54,7 +54,7 @@ namespace
 
   TEST_F(FileOutputStreamTest, write)
   {
-    string path = TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
+    string path = TestHelper::getResourcesFolderLocation() + "tmp-output-stream.txt";
     File file{path};
     file.createNewFile();
     ASSERT_TRUE(file.exists());
@@ -70,7 +70,7 @@ namespace
 
   TEST_F(FileOutputStreamTest, write_with_another_appending_stream)
   {
-    string path = TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
+    string path = TestHelper::getResourcesFolderLocation() + "tmp-output-stream.txt";
     File file{path};
     file.createNewFile();
     ASSERT_TRUE(file.exists());

+ 3 - 3
test/cases/io/FileReaderTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -36,7 +36,7 @@ namespace
 
   TEST_F(FileReaderTest, constructor_file_does_not_exist)
   {
-    File file{TestHelper::getResourcesFolderLocation() + "does_not_exist.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "does-not-exist.txt"};
 
     EXPECT_THROW(
         {
@@ -65,7 +65,7 @@ namespace
 
   TEST_F(FileReaderTest, read_file_gets_lost_in_between)
   {
-    File file{TestHelper::getResourcesFolderLocation() + "lost_readable_file.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "lost-readable-file.txt"};
     file.createNewFile();
     FileReader reader{file};
     file.remove();

+ 20 - 15
test/cases/io/FileTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -33,6 +33,11 @@ namespace
 
       void TearDown() override
       {}
+
+      static bool hasFileInDirectory(const list<string> &_fileNamesInDirectory, const string &_fileName)
+      {
+        return find(_fileNamesInDirectory.begin(), _fileNamesInDirectory.end(), _fileName) != _fileNamesInDirectory.end();
+      }
   };
 
   // comparison operators
@@ -259,19 +264,19 @@ namespace
     ASSERT_EQ(7, filesInDirectory.size());
 
     expectedFile = file.getAbsoluteFilePath() + separator + ".";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + "..";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + "another-file.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + "list-test-sub";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + ".hidden-file.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
   }
 
   TEST_F(FileTest, listFiles)
@@ -285,13 +290,13 @@ namespace
     ASSERT_EQ(4, filesInDirectory.size());
 
     expectedFile = file.getAbsoluteFilePath() + separator + "another-file.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
     expectedFile = file.getAbsoluteFilePath() + separator + ".hidden-file.txt";
-    ASSERT_TRUE((StlUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE(FileTest::hasFileInDirectory(filesInDirectory, expectedFile));
   }
 
   TEST_F(FileTest, makeDirectory)
@@ -345,7 +350,7 @@ namespace
 
   TEST_F(FileTest, remove)
   {
-    string fileName = TestHelper::getResourcesFolderLocation() + "removable_file.txt";
+    string fileName = TestHelper::getResourcesFolderLocation() + "removable-file.txt";
     File file{fileName};
     file.createNewFile();
 
@@ -357,8 +362,8 @@ namespace
 
   TEST_F(FileTest, renameTo)
   {
-    string currentName = TestHelper::getResourcesFolderLocation() + "tmp_rename_to.txt";
-    string newName = TestHelper::getResourcesFolderLocation() + "tmp_rename_to_better_name.txt";
+    string currentName = TestHelper::getResourcesFolderLocation() + "tmp-rename-to.txt";
+    string newName = TestHelper::getResourcesFolderLocation() + "tmp-rename-to-better-name.txt";
 
     File file{currentName};
     file.createNewFile();

+ 5 - 5
test/cases/io/FileWriterTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -35,7 +35,7 @@ namespace
 
   TEST_F(FileWriterTest, constructor_file_does_not_exist)
   {
-    string path = TestHelper::getResourcesFolderLocation() + "not_existing_file.txt";
+    string path = TestHelper::getResourcesFolderLocation() + "not-existing-file.txt";
     File file{path};
 
     EXPECT_THROW(
@@ -54,7 +54,7 @@ namespace
 
   TEST_F(FileWriterTest, reset)
   {
-    string path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
+    string path = TestHelper::getResourcesFolderLocation() + "tmp-file-writer-test.txt";
     File file{path};
     file.createNewFile();
     FileWriter writer{file};
@@ -62,7 +62,7 @@ namespace
 
     // reset
 
-    path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test2.txt";
+    path = TestHelper::getResourcesFolderLocation() + "tmp-file-writer-test2.txt";
     File anotherFile{path};
     anotherFile.createNewFile();
 
@@ -79,7 +79,7 @@ namespace
 
   TEST_F(FileWriterTest, write)
   {
-    string path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
+    string path = TestHelper::getResourcesFolderLocation() + "tmp-file-writer-test.txt";
     File file{path};
 
     ASSERT_FALSE(file.exists());

+ 2 - 2
test/cases/io/StorableFileTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -75,7 +75,7 @@ namespace
 
   TEST_F(StorableFileTest, save)
   {
-    string path = TestHelper::getResourcesFolderLocation() + "tmp_storable_file.txt";
+    string path = TestHelper::getResourcesFolderLocation() + "tmp-storable-file.txt";
     File file{path};
     file.createNewFile();
 

+ 3 - 3
test/cases/io/kv/KvFileReaderTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -64,7 +64,7 @@ namespace
         {
           try
           {
-            KvFileReader reader = KvFileReader(make_shared<KvDocument>(), "invalid_path");
+            KvFileReader reader = KvFileReader(make_shared<KvDocument>(), "invalid-path");
           }
           catch (const IllegalArgumentException &_exception)
           {
@@ -109,7 +109,7 @@ namespace
         {
           try
           {
-            reader->setFile(File{"invalid_path"});
+            reader->setFile(File{"invalid-path"});
           }
           catch (const IllegalArgumentException &_exception)
           {

+ 7 - 7
test/cases/io/logging/LoggerTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -79,7 +79,7 @@ namespace
   {
     // write to log file
 
-    string logName = "output_debug.log";
+    string logName = "output-debug.log";
     shared_ptr<IWriter> writer = createFileLogger(logName);
 
     Logger logger{writer};
@@ -108,7 +108,7 @@ namespace
   {
     // write to log file
 
-    string logName = "output_error.log";
+    string logName = "output-error.log";
     shared_ptr<IWriter> writer = createFileLogger(logName);
 
     Logger logger{writer};
@@ -137,7 +137,7 @@ namespace
   {
     // write to log file
 
-    string logName = "output_fatal.log";
+    string logName = "output-fatal.log";
     shared_ptr<IWriter> writer = createFileLogger(logName);
 
     Logger logger{writer};
@@ -172,7 +172,7 @@ namespace
   {
     // write to log file
 
-    string logName = "output_info.log";
+    string logName = "output-info.log";
     shared_ptr<IWriter> writer = createFileLogger(logName);
 
     Logger logger{writer};
@@ -209,7 +209,7 @@ namespace
   {
     // write to log file
 
-    string logName = "output_trace.log";
+    string logName = "output-trace.log";
     shared_ptr<IWriter> writer = createFileLogger(logName);
 
     Logger logger{writer};
@@ -238,7 +238,7 @@ namespace
   {
     // write to log file
 
-    string logName = "output_warn.log";
+    string logName = "output-warn.log";
     shared_ptr<IWriter> writer = createFileLogger(logName);
 
     Logger logger{writer};

+ 161 - 117
test/cases/io/xml/XmlParserTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2023-02-05
+ * Changed:         2023-02-06
  *
  * */
 
@@ -27,6 +27,50 @@ namespace
       XmlParserTest() = default;
       ~XmlParserTest() override = default;
 
+      static shared_ptr<XmlAttribute> getAttributeAtPosition(const list<shared_ptr<XmlAttribute>> &_attributes, size_t _index)
+      {
+        shared_ptr<XmlAttribute> attribute{};
+        size_t counter{};
+
+        if (_index < _attributes.size())
+        {
+          for (const auto &_value: _attributes)
+          {
+            if (counter == _index)
+            {
+              attribute = _value;
+              break;
+            }
+
+            counter++;
+          }
+        }
+
+        return attribute;
+      }
+
+      static shared_ptr<XmlNode> getChildAtPosition(const list<shared_ptr<XmlNode>> &_children, size_t _index)
+      {
+        shared_ptr<XmlNode> node{};
+        size_t counter{};
+
+        if (_index < _children.size())
+        {
+          for (const auto &_value: _children)
+          {
+            if (counter == _index)
+            {
+              node = _value;
+              break;
+            }
+
+            counter++;
+          }
+        }
+
+        return node;
+      }
+
       static byte_field readXmlStateMachine()
       {
         string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
@@ -88,149 +132,149 @@ namespace
 
     children = root->getChildren();
     ASSERT_EQ(3, children.size());
-    ASSERT_STREQ("states", StlUtils::getListElementAt(children, 0)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(children, 0)->getAttributes().empty());
-    ASSERT_STREQ("currentState", StlUtils::getListElementAt(children, 1)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(children, 1)->getAttributes().empty());
-    ASSERT_STREQ("memory", StlUtils::getListElementAt(children, 2)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(children, 2)->getAttributes().empty());
+    ASSERT_STREQ("states", XmlParserTest::getChildAtPosition(children, 0)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(children, 0)->getAttributes().empty());
+    ASSERT_STREQ("currentState", XmlParserTest::getChildAtPosition(children, 1)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(children, 1)->getAttributes().empty());
+    ASSERT_STREQ("memory", XmlParserTest::getChildAtPosition(children, 2)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(children, 2)->getAttributes().empty());
 
     // states
 
-    statesChildren = StlUtils::getListElementAt(children, 0)->getChildren();
+    statesChildren = XmlParserTest::getChildAtPosition(children, 0)->getChildren();
     ASSERT_EQ(5, statesChildren.size());
 
-    ASSERT_STREQ("state", StlUtils::getListElementAt(statesChildren, 0)->getName().c_str());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 0)->getAttributes().size());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(statesChildren, 0)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("A", StlUtils::getListElementAt(statesChildren, 0)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 0)->getValue().empty());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 0)->getChildren().size());
-    ASSERT_STREQ("connections", StlUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getValue().empty());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getAttributes().empty());
-    connectionChildren = StlUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getChildren();
+    ASSERT_STREQ("state", XmlParserTest::getChildAtPosition(statesChildren, 0)->getName().c_str());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 0)->getAttributes().size());
+    ASSERT_STREQ("id", XmlParserTest::getChildAtPosition(statesChildren, 0)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("A", XmlParserTest::getChildAtPosition(statesChildren, 0)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 0)->getValue().empty());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 0)->getChildren().size());
+    ASSERT_STREQ("connections", XmlParserTest::getChildAtPosition(statesChildren, 0)->getChildren().front()->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 0)->getChildren().front()->getValue().empty());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 0)->getChildren().front()->getAttributes().empty());
+    connectionChildren = XmlParserTest::getChildAtPosition(statesChildren, 0)->getChildren().front()->getChildren();
     ASSERT_EQ(1, connectionChildren.size());
-    ASSERT_STREQ("connection", StlUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = StlUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", XmlParserTest::getChildAtPosition(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(connectionChildren, 0)->getValue().empty());
+    attributes = XmlParserTest::getChildAtPosition(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", StlUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("AB", StlUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", StlUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", StlUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("B", StlUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", StlUtils::getListElementAt(statesChildren, 1)->getName().c_str());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 1)->getAttributes().size());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(statesChildren, 1)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("B", StlUtils::getListElementAt(statesChildren, 1)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 1)->getValue().empty());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 1)->getChildren().size());
-    ASSERT_STREQ("connections", StlUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getValue().empty());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getAttributes().empty());
-    connectionChildren = StlUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getChildren();
+    ASSERT_STREQ("connectionId", XmlParserTest::getAttributeAtPosition(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("AB", XmlParserTest::getAttributeAtPosition(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", XmlParserTest::getAttributeAtPosition(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", XmlParserTest::getAttributeAtPosition(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", XmlParserTest::getAttributeAtPosition(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("B", XmlParserTest::getAttributeAtPosition(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", XmlParserTest::getChildAtPosition(statesChildren, 1)->getName().c_str());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 1)->getAttributes().size());
+    ASSERT_STREQ("id", XmlParserTest::getChildAtPosition(statesChildren, 1)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("B", XmlParserTest::getChildAtPosition(statesChildren, 1)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 1)->getValue().empty());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 1)->getChildren().size());
+    ASSERT_STREQ("connections", XmlParserTest::getChildAtPosition(statesChildren, 1)->getChildren().front()->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 1)->getChildren().front()->getValue().empty());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 1)->getChildren().front()->getAttributes().empty());
+    connectionChildren = XmlParserTest::getChildAtPosition(statesChildren, 1)->getChildren().front()->getChildren();
     ASSERT_EQ(2, connectionChildren.size());
-    ASSERT_STREQ("connection", StlUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = StlUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", XmlParserTest::getChildAtPosition(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(connectionChildren, 0)->getValue().empty());
+    attributes = XmlParserTest::getChildAtPosition(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", StlUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("BC", StlUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", StlUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", StlUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("C", StlUtils::getListElementAt(attributes, 2)->getValue().c_str());
-    ASSERT_STREQ("connection", StlUtils::getListElementAt(connectionChildren, 1)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(connectionChildren, 1)->getValue().empty());
-    attributes = StlUtils::getListElementAt(connectionChildren, 1)->getAttributes();
+    ASSERT_STREQ("connectionId", XmlParserTest::getAttributeAtPosition(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("BC", XmlParserTest::getAttributeAtPosition(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", XmlParserTest::getAttributeAtPosition(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", XmlParserTest::getAttributeAtPosition(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", XmlParserTest::getAttributeAtPosition(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("C", XmlParserTest::getAttributeAtPosition(attributes, 2)->getValue().c_str());
+    ASSERT_STREQ("connection", XmlParserTest::getChildAtPosition(connectionChildren, 1)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(connectionChildren, 1)->getValue().empty());
+    attributes = XmlParserTest::getChildAtPosition(connectionChildren, 1)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", StlUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("BD", StlUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", StlUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", StlUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("D", StlUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", StlUtils::getListElementAt(statesChildren, 2)->getName().c_str());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 2)->getAttributes().size());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(statesChildren, 2)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("C", StlUtils::getListElementAt(statesChildren, 2)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 2)->getValue().empty());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 2)->getChildren().size());
-    ASSERT_STREQ("connections", StlUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getValue().empty());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getAttributes().empty());
-    connectionChildren = StlUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getChildren();
+    ASSERT_STREQ("connectionId", XmlParserTest::getAttributeAtPosition(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("BD", XmlParserTest::getAttributeAtPosition(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", XmlParserTest::getAttributeAtPosition(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", XmlParserTest::getAttributeAtPosition(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", XmlParserTest::getAttributeAtPosition(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("D", XmlParserTest::getAttributeAtPosition(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", XmlParserTest::getChildAtPosition(statesChildren, 2)->getName().c_str());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 2)->getAttributes().size());
+    ASSERT_STREQ("id", XmlParserTest::getChildAtPosition(statesChildren, 2)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("C", XmlParserTest::getChildAtPosition(statesChildren, 2)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 2)->getValue().empty());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 2)->getChildren().size());
+    ASSERT_STREQ("connections", XmlParserTest::getChildAtPosition(statesChildren, 2)->getChildren().front()->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 2)->getChildren().front()->getValue().empty());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 2)->getChildren().front()->getAttributes().empty());
+    connectionChildren = XmlParserTest::getChildAtPosition(statesChildren, 2)->getChildren().front()->getChildren();
     ASSERT_EQ(1, connectionChildren.size());
-    ASSERT_STREQ("connection", StlUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = StlUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", XmlParserTest::getChildAtPosition(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(connectionChildren, 0)->getValue().empty());
+    attributes = XmlParserTest::getChildAtPosition(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", StlUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("CE", StlUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", StlUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", StlUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("E", StlUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", StlUtils::getListElementAt(statesChildren, 3)->getName().c_str());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 3)->getAttributes().size());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(statesChildren, 3)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("D", StlUtils::getListElementAt(statesChildren, 3)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 3)->getChildren().front()->getAttributes().empty());
-    connectionChildren = StlUtils::getListElementAt(statesChildren, 3)->getChildren().front()->getChildren();
+    ASSERT_STREQ("connectionId", XmlParserTest::getAttributeAtPosition(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("CE", XmlParserTest::getAttributeAtPosition(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", XmlParserTest::getAttributeAtPosition(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", XmlParserTest::getAttributeAtPosition(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", XmlParserTest::getAttributeAtPosition(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("E", XmlParserTest::getAttributeAtPosition(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", XmlParserTest::getChildAtPosition(statesChildren, 3)->getName().c_str());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 3)->getAttributes().size());
+    ASSERT_STREQ("id", XmlParserTest::getChildAtPosition(statesChildren, 3)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("D", XmlParserTest::getChildAtPosition(statesChildren, 3)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 3)->getChildren().front()->getAttributes().empty());
+    connectionChildren = XmlParserTest::getChildAtPosition(statesChildren, 3)->getChildren().front()->getChildren();
     ASSERT_EQ(1, connectionChildren.size());
-    ASSERT_STREQ("connection", StlUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = StlUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", XmlParserTest::getChildAtPosition(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(connectionChildren, 0)->getValue().empty());
+    attributes = XmlParserTest::getChildAtPosition(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", StlUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("DE", StlUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", StlUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", StlUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("E", StlUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", StlUtils::getListElementAt(statesChildren, 4)->getName().c_str());
-    ASSERT_EQ(1, StlUtils::getListElementAt(statesChildren, 4)->getAttributes().size());
-    ASSERT_STREQ("id", StlUtils::getListElementAt(statesChildren, 4)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("E", StlUtils::getListElementAt(statesChildren, 4)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(statesChildren, 4)->getChildren().empty());
+    ASSERT_STREQ("connectionId", XmlParserTest::getAttributeAtPosition(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("DE", XmlParserTest::getAttributeAtPosition(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", XmlParserTest::getAttributeAtPosition(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", XmlParserTest::getAttributeAtPosition(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", XmlParserTest::getAttributeAtPosition(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("E", XmlParserTest::getAttributeAtPosition(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", XmlParserTest::getChildAtPosition(statesChildren, 4)->getName().c_str());
+    ASSERT_EQ(1, XmlParserTest::getChildAtPosition(statesChildren, 4)->getAttributes().size());
+    ASSERT_STREQ("id", XmlParserTest::getChildAtPosition(statesChildren, 4)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("E", XmlParserTest::getChildAtPosition(statesChildren, 4)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(statesChildren, 4)->getChildren().empty());
 
     // current state
 
-    ASSERT_STREQ("currentState", StlUtils::getListElementAt(children, 1)->getName().c_str());
-    ASSERT_STREQ("A", StlUtils::getListElementAt(children, 1)->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(children, 1)->getChildren().empty());
-    ASSERT_TRUE(StlUtils::getListElementAt(children, 1)->getAttributes().empty());
+    ASSERT_STREQ("currentState", XmlParserTest::getChildAtPosition(children, 1)->getName().c_str());
+    ASSERT_STREQ("A", XmlParserTest::getChildAtPosition(children, 1)->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(children, 1)->getChildren().empty());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(children, 1)->getAttributes().empty());
 
     // memory
 
-    memoryChildren = StlUtils::getListElementAt(children, 2)->getChildren();
+    memoryChildren = XmlParserTest::getChildAtPosition(children, 2)->getChildren();
     ASSERT_EQ(3, memoryChildren.size());
 
-    ASSERT_STREQ("location", StlUtils::getListElementAt(memoryChildren, 0)->getName().c_str());
-    ASSERT_STREQ("A", StlUtils::getListElementAt(memoryChildren, 0)->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(memoryChildren, 0)->getChildren().empty());
-    ASSERT_TRUE(StlUtils::getListElementAt(memoryChildren, 0)->getAttributes().empty());
+    ASSERT_STREQ("location", XmlParserTest::getChildAtPosition(memoryChildren, 0)->getName().c_str());
+    ASSERT_STREQ("A", XmlParserTest::getChildAtPosition(memoryChildren, 0)->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(memoryChildren, 0)->getChildren().empty());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(memoryChildren, 0)->getAttributes().empty());
 
-    ASSERT_STREQ("location", StlUtils::getListElementAt(memoryChildren, 1)->getName().c_str());
-    ASSERT_STREQ("B", StlUtils::getListElementAt(memoryChildren, 1)->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(memoryChildren, 1)->getChildren().empty());
-    ASSERT_TRUE(StlUtils::getListElementAt(memoryChildren, 1)->getAttributes().empty());
+    ASSERT_STREQ("location", XmlParserTest::getChildAtPosition(memoryChildren, 1)->getName().c_str());
+    ASSERT_STREQ("B", XmlParserTest::getChildAtPosition(memoryChildren, 1)->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(memoryChildren, 1)->getChildren().empty());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(memoryChildren, 1)->getAttributes().empty());
 
-    ASSERT_STREQ("location", StlUtils::getListElementAt(memoryChildren, 2)->getName().c_str());
-    ASSERT_STREQ("C", StlUtils::getListElementAt(memoryChildren, 2)->getValue().c_str());
-    ASSERT_TRUE(StlUtils::getListElementAt(memoryChildren, 2)->getChildren().empty());
-    ASSERT_TRUE(StlUtils::getListElementAt(memoryChildren, 2)->getAttributes().empty());
+    ASSERT_STREQ("location", XmlParserTest::getChildAtPosition(memoryChildren, 2)->getName().c_str());
+    ASSERT_STREQ("C", XmlParserTest::getChildAtPosition(memoryChildren, 2)->getValue().c_str());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(memoryChildren, 2)->getChildren().empty());
+    ASSERT_TRUE(XmlParserTest::getChildAtPosition(memoryChildren, 2)->getAttributes().empty());
   }
 
   TEST_F(XmlParserTest, getDocument)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     XmlParser xmlParser{make_shared<XmlDocument>()};
 
     ASSERT_TRUE(xmlParser.getDocument() != nullptr);
@@ -238,7 +282,7 @@ namespace
 
   TEST_F(XmlParserTest, setDocument)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     shared_ptr<XmlDocument> document = make_shared<XmlDocument>();
     XmlParser xmlParser{document};
     ASSERT_TRUE(xmlParser.getDocument() == document);