SerializableSectionPairParameterTest.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Co-Author: Claude Sonnet 4.6 (LLM)
  4. * Company: Lynar Studios
  5. * E-Mail: webmaster@lynarstudios.com
  6. * Created: 2023-02-17
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #include <gtest/gtest.h>
  11. #include <ls-std/ls-std-io.hpp>
  12. #include <memory>
  13. using ls::standard::io::NewLine;
  14. using ls::standard::io::SectionPairRowSingleValue;
  15. using ls::standard::io::SerializableSectionPairParameter;
  16. using std::make_shared;
  17. using testing::Test;
  18. namespace
  19. {
  20. class SerializableSectionPairParameterTest : public Test
  21. {
  22. public:
  23. SerializableSectionPairParameterTest() = default;
  24. ~SerializableSectionPairParameterTest() override = default;
  25. };
  26. TEST_F(SerializableSectionPairParameterTest, getNewLine)
  27. {
  28. ASSERT_STREQ(NewLine::get().c_str(), SerializableSectionPairParameter{}.getNewLine().c_str());
  29. }
  30. TEST_F(SerializableSectionPairParameterTest, getValue)
  31. {
  32. ASSERT_TRUE(SerializableSectionPairParameter{}.getValue() == nullptr);
  33. }
  34. TEST_F(SerializableSectionPairParameterTest, setNewLine)
  35. {
  36. SerializableSectionPairParameter parameter{};
  37. parameter.setNewLine("\r\n");
  38. ASSERT_STREQ("\r\n", parameter.getNewLine().c_str());
  39. }
  40. TEST_F(SerializableSectionPairParameterTest, setValue)
  41. {
  42. SerializableSectionPairParameter parameter{};
  43. parameter.setValue(make_shared<SectionPairRowSingleValue>("blue"));
  44. ASSERT_TRUE(parameter.getValue() != nullptr);
  45. }
  46. }