Эх сурвалжийг харах

Add validator for section pair single value row

Patrick-Christopher Mattulat 2 жил өмнө
parent
commit
e2168998a5

+ 6 - 4
CMakeLists.txt

@@ -171,7 +171,7 @@ set(SOURCE_FILES_IO
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/logging/Logger.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/logging/LogLevel.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairIdentifierArgumentEvaluator.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairDocument.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRow.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowListValue.cpp
@@ -179,8 +179,9 @@ set(SOURCE_FILES_IO
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowValue.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairSection.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairIdentifierValidator.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowValueValidator.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairSectionIdUnmarshalValidator.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairValueValidator.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairDocument.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairParameter.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairRow.cpp
@@ -269,10 +270,11 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LogLevelTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairIdentifierArgumentEvaluatorTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluatorTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairValueArgumentEvaluatorTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairIdentifierValidatorTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowValueValidatorTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowSingleValueValidatorTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairSectionIdUnmarshalValidatorTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairValueValidatorTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairDocumentTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowListValueTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowSingleValueTest.cpp

+ 6 - 6
include/ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.hpp → include/ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.hpp

@@ -3,12 +3,12 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-10
-* Changed:         2023-02-17
+* Changed:         2023-02-19
 *
 * */
 
-#ifndef LS_STD_SECTION_PAIR_ROW_VALUE_ARGUMENT_EVALUATOR_HPP
-#define LS_STD_SECTION_PAIR_ROW_VALUE_ARGUMENT_EVALUATOR_HPP
+#ifndef LS_STD_SECTION_PAIR_VALUE_ARGUMENT_EVALUATOR_HPP
+#define LS_STD_SECTION_PAIR_VALUE_ARGUMENT_EVALUATOR_HPP
 
 #include <ls-std/core/Class.hpp>
 #include <ls-std/core/interface/IEvaluator.hpp>
@@ -18,12 +18,12 @@
 
 namespace ls::std::io
 {
-  class LS_STD_DYNAMIC_GOAL SectionPairRowValueArgumentEvaluator : public ls::std::core::interface_type::IEvaluator, public ls::std::core::Class
+  class LS_STD_DYNAMIC_GOAL SectionPairValueArgumentEvaluator : public ls::std::core::interface_type::IEvaluator, public ls::std::core::Class
   {
     public:
 
-      explicit SectionPairRowValueArgumentEvaluator(ls::std::io::section_pair_row_value _value, ::std::string _message);
-      ~SectionPairRowValueArgumentEvaluator() override;
+      explicit SectionPairValueArgumentEvaluator(ls::std::io::section_pair_row_value _value, ::std::string _message);
+      ~SectionPairValueArgumentEvaluator() override;
 
       void evaluate() override;
 

+ 36 - 0
include/ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.hpp

@@ -0,0 +1,36 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-19
+* Changed:         2023-02-19
+*
+* */
+
+#ifndef LS_STD_SECTION_PAIR_ROW_SINGLE_VALUE_VALIDATOR_HPP
+#define LS_STD_SECTION_PAIR_ROW_SINGLE_VALUE_VALIDATOR_HPP
+
+#include <ls-std/core/Class.hpp>
+#include <ls-std/core/interface/IValidator.hpp>
+#include <ls-std/os/dynamic-goal.hpp>
+
+namespace ls::std::io
+{
+  class LS_STD_DYNAMIC_GOAL SectionPairRowSingleValueValidator : public ls::std::core::Class, public ls::std::core::interface_type::IValidator
+  {
+    public:
+
+      explicit SectionPairRowSingleValueValidator(::std::string _singleValueRow);
+      ~SectionPairRowSingleValueValidator() override;
+
+      [[nodiscard]] bool isValid() override;
+
+    private:
+
+      ::std::string singleValueRow{};
+
+      [[nodiscard]] static ::std::string _getValidationRegex();
+  };
+}
+
+#endif

+ 6 - 6
include/ls-std/io/section-pair/validator/SectionPairRowValueValidator.hpp → include/ls-std/io/section-pair/validator/SectionPairValueValidator.hpp

@@ -3,12 +3,12 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-09
-* Changed:         2023-02-18
+* Changed:         2023-02-19
 *
 * */
 
-#ifndef LS_STD_SECTION_PAIR_ROW_VALUE_VALIDATOR_HPP
-#define LS_STD_SECTION_PAIR_ROW_VALUE_VALIDATOR_HPP
+#ifndef LS_STD_SECTION_PAIR_VALUE_VALIDATOR_HPP
+#define LS_STD_SECTION_PAIR_VALUE_VALIDATOR_HPP
 
 #include <ls-std/core/Class.hpp>
 #include <ls-std/core/interface/IValidator.hpp>
@@ -18,12 +18,12 @@
 
 namespace ls::std::io
 {
-  class LS_STD_DYNAMIC_GOAL SectionPairRowValueValidator : public ls::std::core::Class, public ls::std::core::interface_type::IValidator
+  class LS_STD_DYNAMIC_GOAL SectionPairValueValidator : public ls::std::core::Class, public ls::std::core::interface_type::IValidator
   {
     public:
 
-      explicit SectionPairRowValueValidator(ls::std::io::section_pair_row_value _value);
-      ~SectionPairRowValueValidator() override;
+      explicit SectionPairValueValidator(ls::std::io::section_pair_row_value _value);
+      ~SectionPairValueValidator() override;
 
       [[nodiscard]] static ::std::string getValidationRegex();
       [[nodiscard]] bool isValid() override;

+ 4 - 3
include/ls-std/ls-std-io.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2023-02-11
- * Changed:         2023-02-17
+ * Changed:         2023-02-19
  *
  * */
 
@@ -17,7 +17,7 @@
 #include <ls-std/io/section-pair/SectionPairRowEnumType.hpp>
 #include <ls-std/io/section-pair/SectionPairTypes.hpp>
 #include <ls-std/io/section-pair/evaluator/SectionPairIdentifierArgumentEvaluator.hpp>
-#include <ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.hpp>
+#include <ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.hpp>
 #include <ls-std/io/section-pair/model/SectionPairDocument.hpp>
 #include <ls-std/io/section-pair/model/SectionPairRow.hpp>
 #include <ls-std/io/section-pair/model/SectionPairRowListValue.hpp>
@@ -33,8 +33,9 @@
 #include <ls-std/io/section-pair/type/SectionPairDocumentTypes.hpp>
 #include <ls-std/io/section-pair/type/SectionPairSectionTypes.hpp>
 #include <ls-std/io/section-pair/validator/SectionPairIdentifierValidator.hpp>
-#include <ls-std/io/section-pair/validator/SectionPairRowValueValidator.hpp>
+#include <ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.hpp>
 #include <ls-std/io/section-pair/validator/SectionPairSectionIdUnmarshalValidator.hpp>
+#include <ls-std/io/section-pair/validator/SectionPairValueValidator.hpp>
 
 #include <ls-std/io/xml/XmlAttribute.hpp>
 #include <ls-std/io/xml/XmlDeclaration.hpp>

+ 0 - 25
source/ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.cpp

@@ -1,25 +0,0 @@
-/*
-* Author:          Patrick-Christopher Mattulat
-* Company:         Lynar Studios
-* E-Mail:          webmaster@lynarstudios.com
-* Created:         2023-02-10
-* Changed:         2023-02-17
-*
-* */
-
-#include <ls-std/core/exception/IllegalArgumentException.hpp>
-#include <ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.hpp>
-#include <ls-std/io/section-pair/validator/SectionPairRowValueValidator.hpp>
-
-ls::std::io::SectionPairRowValueArgumentEvaluator::SectionPairRowValueArgumentEvaluator(ls::std::io::section_pair_row_value _value, ::std::string _message) : ls::std::core::Class("SectionPairRowValueArgumentEvaluator"), value(::std::move(_value)), message(::std::move(_message))
-{}
-
-ls::std::io::SectionPairRowValueArgumentEvaluator::~SectionPairRowValueArgumentEvaluator() = default;
-
-void ls::std::io::SectionPairRowValueArgumentEvaluator::evaluate()
-{
-  if (!ls::std::io::SectionPairRowValueValidator(this->value).isValid())
-  {
-    throw ls::std::core::IllegalArgumentException{this->message};
-  }
-}

+ 25 - 0
source/ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.cpp

@@ -0,0 +1,25 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-10
+* Changed:         2023-02-19
+*
+* */
+
+#include <ls-std/core/exception/IllegalArgumentException.hpp>
+#include <ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.hpp>
+#include <ls-std/io/section-pair/validator/SectionPairValueValidator.hpp>
+
+ls::std::io::SectionPairValueArgumentEvaluator::SectionPairValueArgumentEvaluator(ls::std::io::section_pair_row_value _value, ::std::string _message) : ls::std::core::Class("SectionPairValueArgumentEvaluator"), value(::std::move(_value)), message(::std::move(_message))
+{}
+
+ls::std::io::SectionPairValueArgumentEvaluator::~SectionPairValueArgumentEvaluator() = default;
+
+void ls::std::io::SectionPairValueArgumentEvaluator::evaluate()
+{
+  if (!ls::std::io::SectionPairValueValidator(this->value).isValid())
+  {
+    throw ls::std::core::IllegalArgumentException{this->message};
+  }
+}

+ 3 - 3
source/ls-std/io/section-pair/model/SectionPairRowListValue.cpp

@@ -3,14 +3,14 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-10
-* Changed:         2023-02-17
+* Changed:         2023-02-19
 *
 * */
 
 #include <ls-std/core/ConditionalFunctionExecutor.hpp>
 #include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
 #include <ls-std/core/evaluator/IndexOutOfBoundsEvaluator.hpp>
-#include <ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.hpp>
+#include <ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.hpp>
 #include <ls-std/io/section-pair/model/SectionPairRowListValue.hpp>
 #include <ls-std/io/section-pair/serialization/SerializableSectionPairRowListValue.hpp>
 #include <string>
@@ -23,7 +23,7 @@ ls::std::io::SectionPairRowListValue::~SectionPairRowListValue() = default;
 void ls::std::io::SectionPairRowListValue::add(const ls::std::io::section_pair_row_value &_value)
 {
   ls::std::core::EmptyStringArgumentEvaluator{_value}.evaluate();
-  ls::std::io::SectionPairRowValueArgumentEvaluator{_value, "section pair row list value \"" + _value + "\" contains invalid characters!"}.evaluate();
+  ls::std::io::SectionPairValueArgumentEvaluator{_value, "section pair row list value \"" + _value + "\" contains invalid characters!"}.evaluate();
   this->values.push_back(_value);
 }
 

+ 3 - 3
source/ls-std/io/section-pair/model/SectionPairRowSingleValue.cpp

@@ -3,14 +3,14 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-10
-* Changed:         2023-02-17
+* Changed:         2023-02-19
 *
 * */
 
 #include <ls-std/core/ConditionalFunctionExecutor.hpp>
 #include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
 #include <ls-std/io/NewLine.hpp>
-#include <ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.hpp>
+#include <ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.hpp>
 #include <ls-std/io/section-pair/model/SectionPairRowSingleValue.hpp>
 #include <ls-std/io/section-pair/serialization/SerializableSectionPairRowSingleValue.hpp>
 
@@ -64,7 +64,7 @@ void ls::std::io::SectionPairRowSingleValue::_createSerializable()
 void ls::std::io::SectionPairRowSingleValue::_set(const ls::std::io::section_pair_row_value &_value)
 {
   ls::std::core::EmptyStringArgumentEvaluator{_value}.evaluate();
-  ls::std::io::SectionPairRowValueArgumentEvaluator(_value, this->getClassName() + ": section pair single value \"" + _value + "\" contains invalid characters!").evaluate();
+  ls::std::io::SectionPairValueArgumentEvaluator(_value, this->getClassName() + ": section pair single value \"" + _value + "\" contains invalid characters!").evaluate();
   ::std::string newLine = this->reservedNewLine.empty() ? NewLine::get() : this->reservedNewLine;
   this->value = _value;
 

+ 35 - 0
source/ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.cpp

@@ -0,0 +1,35 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-19
+* Changed:         2023-02-19
+*
+* */
+
+#include <ls-std/io/section-pair/validator/SectionPairIdentifierValidator.hpp>
+#include <ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.hpp>
+#include <ls-std/io/section-pair/validator/SectionPairValueValidator.hpp>
+#include <regex>
+
+ls::std::io::SectionPairRowSingleValueValidator::SectionPairRowSingleValueValidator(::std::string _singleValueRow) : ls::std::core::Class("SectionPairRowSingleValueValidator"), singleValueRow(::std::move(_singleValueRow))
+{}
+
+ls::std::io::SectionPairRowSingleValueValidator::~SectionPairRowSingleValueValidator() = default;
+
+bool ls::std::io::SectionPairRowSingleValueValidator::isValid()
+{
+  ::std::string validationRegex = ls::std::io::SectionPairRowSingleValueValidator::_getValidationRegex();
+  ::std::string concatenation = "(^" + validationRegex + ")|(^" + validationRegex + R"(\n{1})|(^)" + validationRegex + R"(\r{1}\n{1}))";
+  static ::std::regex singleValueRowRegex{concatenation};
+
+  return ::std::regex_match(this->singleValueRow, singleValueRowRegex);
+}
+
+::std::string ls::std::io::SectionPairRowSingleValueValidator::_getValidationRegex()
+{
+  ::std::string identifierRegex = ls::std::io::SectionPairIdentifierValidator::getValidationRegex();
+  ::std::string valueRegex = ls::std::io::SectionPairValueValidator::getValidationRegex();
+
+  return "(" + identifierRegex + R"(={1})" + valueRegex + ")";
+}

+ 0 - 38
source/ls-std/io/section-pair/validator/SectionPairRowValueValidator.cpp

@@ -1,38 +0,0 @@
-/*
-* Author:          Patrick-Christopher Mattulat
-* Company:         Lynar Studios
-* E-Mail:          webmaster@lynarstudios.com
-* Created:         2023-02-09
-* Changed:         2023-02-18
-*
-* */
-
-#include <ls-std/io/NewLine.hpp>
-#include <ls-std/io/section-pair/validator/SectionPairRowValueValidator.hpp>
-#include <regex>
-
-ls::std::io::SectionPairRowValueValidator::SectionPairRowValueValidator(ls::std::io::section_pair_row_value _value) : ls::std::core::Class("SectionPairRowValueValidator"), value(::std::move(_value))
-{}
-
-ls::std::io::SectionPairRowValueValidator::~SectionPairRowValueValidator() = default;
-
-::std::string ls::std::io::SectionPairRowValueValidator::getValidationRegex()
-{
-  ::std::string validationRegex = ls::std::io::SectionPairRowValueValidator::_getValidationRegex();
-  return "(" + validationRegex + ")|(" + validationRegex + "\\n{1})|(" + validationRegex + "\\r{1}\\n{1})";
-}
-
-bool ls::std::io::SectionPairRowValueValidator::isValid()
-{
-  ::std::string validationRegex = ls::std::io::SectionPairRowValueValidator::_getValidationRegex();
-  ::std::string concatenation = "(^" + validationRegex + ")|(^" + validationRegex + R"(\n{1})|(^)" + validationRegex + R"(\r{1}\n{1}))";
-  static ::std::regex valueRegex{concatenation};
-
-  return ::std::regex_match(this->value, valueRegex);
-}
-
-::std::string ls::std::io::SectionPairRowValueValidator::_getValidationRegex()
-{
-  ::std::string value = R"([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32})";
-  return value;
-}

+ 38 - 0
source/ls-std/io/section-pair/validator/SectionPairValueValidator.cpp

@@ -0,0 +1,38 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-09
+* Changed:         2023-02-19
+*
+* */
+
+#include <ls-std/io/NewLine.hpp>
+#include <ls-std/io/section-pair/validator/SectionPairValueValidator.hpp>
+#include <regex>
+
+ls::std::io::SectionPairValueValidator::SectionPairValueValidator(ls::std::io::section_pair_row_value _value) : ls::std::core::Class("SectionPairValueValidator"), value(::std::move(_value))
+{}
+
+ls::std::io::SectionPairValueValidator::~SectionPairValueValidator() = default;
+
+::std::string ls::std::io::SectionPairValueValidator::getValidationRegex()
+{
+  ::std::string validationRegex = ls::std::io::SectionPairValueValidator::_getValidationRegex();
+  return "(" + validationRegex + ")|(" + validationRegex + "\\n{1})|(" + validationRegex + "\\r{1}\\n{1})";
+}
+
+bool ls::std::io::SectionPairValueValidator::isValid()
+{
+  ::std::string validationRegex = ls::std::io::SectionPairValueValidator::_getValidationRegex();
+  ::std::string concatenation = "(^" + validationRegex + ")|(^" + validationRegex + R"(\n{1})|(^)" + validationRegex + R"(\r{1}\n{1}))";
+  static ::std::regex valueRegex{concatenation};
+
+  return ::std::regex_match(this->value, valueRegex);
+}
+
+::std::string ls::std::io::SectionPairValueValidator::_getValidationRegex()
+{
+  ::std::string value = R"([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32})";
+  return value;
+}

+ 9 - 9
test/cases/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluatorTest.cpp → test/cases/io/section-pair/evaluator/SectionPairValueArgumentEvaluatorTest.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-10
-* Changed:         2023-02-17
+* Changed:         2023-02-19
 *
 * */
 
@@ -18,12 +18,12 @@ using namespace ::std;
 
 namespace
 {
-  class SectionPairRowValueArgumentEvaluatorTest : public ::testing::Test
+  class SectionPairValueArgumentEvaluatorTest : public ::testing::Test
   {
     protected:
 
-      SectionPairRowValueArgumentEvaluatorTest() = default;
-      ~SectionPairRowValueArgumentEvaluatorTest() override = default;
+      SectionPairValueArgumentEvaluatorTest() = default;
+      ~SectionPairValueArgumentEvaluatorTest() override = default;
 
       void SetUp() override
       {}
@@ -32,19 +32,19 @@ namespace
       {}
   };
 
-  TEST_F(SectionPairRowValueArgumentEvaluatorTest, getClassName)
+  TEST_F(SectionPairValueArgumentEvaluatorTest, getClassName)
   {
-    shared_ptr<SectionPairRowValueArgumentEvaluator> evaluator = make_shared<SectionPairRowValueArgumentEvaluator>("=33", "section pair value contains invalid characters!");
-    ASSERT_STREQ("SectionPairRowValueArgumentEvaluator", evaluator->getClassName().c_str());
+    shared_ptr<SectionPairValueArgumentEvaluator> evaluator = make_shared<SectionPairValueArgumentEvaluator>("=33", "section pair value contains invalid characters!");
+    ASSERT_STREQ("SectionPairValueArgumentEvaluator", evaluator->getClassName().c_str());
   }
 
-  TEST_F(SectionPairRowValueArgumentEvaluatorTest, evaluate)
+  TEST_F(SectionPairValueArgumentEvaluatorTest, evaluate)
   {
     EXPECT_THROW(
         {
           try
           {
-            SectionPairRowValueArgumentEvaluator("=33", "section pair value contains invalid characters!").evaluate();
+            SectionPairValueArgumentEvaluator("=33", "section pair value contains invalid characters!").evaluate();
           }
           catch (const IllegalArgumentException &_exception)
           {

+ 68 - 0
test/cases/io/section-pair/validator/SectionPairRowSingleValueValidatorTest.cpp

@@ -0,0 +1,68 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-19
+* Changed:         2023-02-19
+*
+* */
+
+#include <gtest/gtest.h>
+#include <ls-std/ls-std-core.hpp>
+#include <ls-std/ls-std-io.hpp>
+#include <string>
+
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ::std;
+
+namespace
+{
+  class SectionPairRowSingleValueValidatorTest : public ::testing::Test
+  {
+    protected:
+
+      SectionPairRowSingleValueValidatorTest() = default;
+      ~SectionPairRowSingleValueValidatorTest() override = default;
+
+      void SetUp() override
+      {}
+
+      void TearDown() override
+      {}
+  };
+
+  class SectionPairRowSingleValueValidatorIsValidTest : public ::testing::TestWithParam<string>
+  {
+    protected:
+
+      SectionPairRowSingleValueValidatorIsValidTest() = default;
+      ~SectionPairRowSingleValueValidatorIsValidTest() override = default;
+  };
+
+  class SectionPairRowSingleValueValidatorNotValidTest : public ::testing::TestWithParam<string>
+  {
+    protected:
+
+      SectionPairRowSingleValueValidatorNotValidTest() = default;
+      ~SectionPairRowSingleValueValidatorNotValidTest() override = default;
+  };
+
+  TEST_F(SectionPairRowSingleValueValidatorTest, getClassName)
+  {
+    ASSERT_STREQ("SectionPairRowSingleValueValidator", SectionPairRowSingleValueValidator{"tmp-key"}.getClassName().c_str());
+  }
+
+  TEST_P(SectionPairRowSingleValueValidatorIsValidTest, isValid)
+  {
+    ASSERT_TRUE(SectionPairRowSingleValueValidator{GetParam()}.isValid());
+  }
+
+  TEST_P(SectionPairRowSingleValueValidatorNotValidTest, isValid_not_valid)
+  {
+    ASSERT_FALSE(SectionPairRowSingleValueValidator{GetParam()}.isValid());
+  }
+
+  INSTANTIATE_TEST_SUITE_P(SectionPairRowSingleValueValidatorTest, SectionPairRowSingleValueValidatorIsValidTest, ::testing::Values("favourite-color=blue" + NewLine::getUnixNewLine(), "hair-color=red" + NewLine::getWindowsNewLine(), "height=167"));
+  INSTANTIATE_TEST_SUITE_P(SectionPairRowSingleValueValidatorTest, SectionPairRowSingleValueValidatorNotValidTest, ::testing::Values("color blue"));
+}

+ 0 - 76
test/cases/io/section-pair/validator/SectionPairRowValueValidatorTest.cpp

@@ -1,76 +0,0 @@
-/*
-* Author:          Patrick-Christopher Mattulat
-* Company:         Lynar Studios
-* E-Mail:          webmaster@lynarstudios.com
-* Created:         2023-02-09
-* Changed:         2023-02-18
-*
-* */
-
-#include <gtest/gtest.h>
-#include <ls-std/ls-std-core.hpp>
-#include <ls-std/ls-std-io.hpp>
-#include <string>
-
-using namespace ls::std::core;
-using namespace ls::std::io;
-using namespace ::std;
-
-namespace
-{
-  class SectionPairRowValueValidatorTest : public ::testing::Test
-  {
-    protected:
-
-      SectionPairRowValueValidatorTest() = default;
-      ~SectionPairRowValueValidatorTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  class SectionPairRowValueValidatorValidTest : public ::testing::TestWithParam<string>
-  {
-    protected:
-
-      SectionPairRowValueValidatorValidTest() = default;
-      ~SectionPairRowValueValidatorValidTest() override = default;
-  };
-
-  class SectionPairRowValueValidatorNotValidTest : public ::testing::TestWithParam<string>
-  {
-    protected:
-
-      SectionPairRowValueValidatorNotValidTest() = default;
-      ~SectionPairRowValueValidatorNotValidTest() override = default;
-  };
-
-  TEST_F(SectionPairRowValueValidatorTest, getClassName)
-  {
-    ASSERT_STREQ("SectionPairRowValueValidator", SectionPairRowValueValidator{"any value"}.getClassName().c_str());
-  }
-
-  TEST_F(SectionPairRowValueValidatorTest, getValidationRegex)
-  {
-    string expected = R"(([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32})|([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32}\n{1})|([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32}\r{1}\n{1}))";
-    string actual = SectionPairRowValueValidator::getValidationRegex();
-
-    ASSERT_STREQ(expected.c_str(), actual.c_str());
-  }
-
-  TEST_P(SectionPairRowValueValidatorValidTest, isValid)
-  {
-    ASSERT_TRUE(SectionPairRowValueValidator{GetParam()}.isValid());
-  }
-
-  TEST_P(SectionPairRowValueValidatorNotValidTest, isValid_not_valid)
-  {
-    ASSERT_FALSE(SectionPairRowValueValidator{GetParam()}.isValid());
-  }
-
-  INSTANTIATE_TEST_SUITE_P(SectionPairRowValueValidatorTest, SectionPairRowValueValidatorValidTest, ::testing::Values("blue is my favourite color!", "Age", "Tom", "\"Tom\"", "Hello!" + NewLine::getUnixNewLine(), "Hello!" + NewLine::getWindowsNewLine()));
-  INSTANTIATE_TEST_SUITE_P(SectionPairRowValueValidatorTest, SectionPairRowValueValidatorNotValidTest, ::testing::Values("1+2=3", "\\escape"));
-}

+ 76 - 0
test/cases/io/section-pair/validator/SectionPairValueValidatorTest.cpp

@@ -0,0 +1,76 @@
+/*
+* Author:          Patrick-Christopher Mattulat
+* Company:         Lynar Studios
+* E-Mail:          webmaster@lynarstudios.com
+* Created:         2023-02-09
+* Changed:         2023-02-19
+*
+* */
+
+#include <gtest/gtest.h>
+#include <ls-std/ls-std-core.hpp>
+#include <ls-std/ls-std-io.hpp>
+#include <string>
+
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ::std;
+
+namespace
+{
+  class SectionPairValueValidatorTest : public ::testing::Test
+  {
+    protected:
+
+      SectionPairValueValidatorTest() = default;
+      ~SectionPairValueValidatorTest() override = default;
+
+      void SetUp() override
+      {}
+
+      void TearDown() override
+      {}
+  };
+
+  class SectionPairValueValidatorValidTest : public ::testing::TestWithParam<string>
+  {
+    protected:
+
+      SectionPairValueValidatorValidTest() = default;
+      ~SectionPairValueValidatorValidTest() override = default;
+  };
+
+  class SectionPairValueValidatorNotValidTest : public ::testing::TestWithParam<string>
+  {
+    protected:
+
+      SectionPairValueValidatorNotValidTest() = default;
+      ~SectionPairValueValidatorNotValidTest() override = default;
+  };
+
+  TEST_F(SectionPairValueValidatorTest, getClassName)
+  {
+    ASSERT_STREQ("SectionPairValueValidator", SectionPairValueValidator{"any value"}.getClassName().c_str());
+  }
+
+  TEST_F(SectionPairValueValidatorTest, getValidationRegex)
+  {
+    string expected = R"(([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32})|([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32}\n{1})|([a-zA-Z0-9\-_#!?\[\]\{\}\(\)\$ۤ<>+:;., \*\/"]{1,32}\r{1}\n{1}))";
+    string actual = SectionPairValueValidator::getValidationRegex();
+
+    ASSERT_STREQ(expected.c_str(), actual.c_str());
+  }
+
+  TEST_P(SectionPairValueValidatorValidTest, isValid)
+  {
+    ASSERT_TRUE(SectionPairValueValidator{GetParam()}.isValid());
+  }
+
+  TEST_P(SectionPairValueValidatorNotValidTest, isValid_not_valid)
+  {
+    ASSERT_FALSE(SectionPairValueValidator{GetParam()}.isValid());
+  }
+
+  INSTANTIATE_TEST_SUITE_P(SectionPairValueValidatorTest, SectionPairValueValidatorValidTest, ::testing::Values("blue is my favourite color!", "Age", "Tom", "\"Tom\"", "Hello!" + NewLine::getUnixNewLine(), "Hello!" + NewLine::getWindowsNewLine()));
+  INSTANTIATE_TEST_SUITE_P(SectionPairValueValidatorTest, SectionPairValueValidatorNotValidTest, ::testing::Values("1+2=3", "\\escape"));
+}