SectionPairRowTest.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-08
  6. * Changed: 2023-02-08
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls-std/ls-std-core.hpp>
  11. #include <ls-std/ls-std-io.hpp>
  12. using namespace ls::std::core;
  13. using namespace ls::std::io;
  14. using namespace ::std;
  15. namespace
  16. {
  17. class SectionPairRowTest : public ::testing::Test
  18. {
  19. protected:
  20. SectionPairRowTest() = default;
  21. ~SectionPairRowTest() override = default;
  22. void SetUp() override
  23. {}
  24. void TearDown() override
  25. {}
  26. };
  27. TEST_F(SectionPairRowTest, getClassName)
  28. {
  29. ASSERT_STREQ("SectionPairRow", SectionPairRow{"TMP_KEY"}.getClassName().c_str());
  30. }
  31. TEST_F(SectionPairRowTest, getValue)
  32. {
  33. SectionPairRow row{"TMP_KEY"};
  34. ASSERT_TRUE(row.getValue().empty());
  35. }
  36. TEST_F(SectionPairRowTest, isKeyValue)
  37. {
  38. ASSERT_FALSE(SectionPairRow{"TMP_KEY"}.isKeyValue());
  39. }
  40. TEST_F(SectionPairRowTest, isList)
  41. {
  42. ASSERT_FALSE(SectionPairRow{"TMP_KEY"}.isList());
  43. }
  44. TEST_F(SectionPairRowTest, setValue_key_value)
  45. {
  46. SectionPairRow row{"color"};
  47. row.setValue("blue");
  48. ASSERT_STREQ("blue", row.getValue().c_str());
  49. }
  50. }