SectionPairFileReaderParameterTest.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-21
  6. * Changed: 2023-02-21
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls-std/ls-std-io.hpp>
  11. using namespace ls::std::io;
  12. using namespace ::std;
  13. namespace
  14. {
  15. class SectionPairFileReaderParameterTest : public ::testing::Test
  16. {
  17. protected:
  18. SectionPairFileReaderParameterTest() = default;
  19. ~SectionPairFileReaderParameterTest() override = default;
  20. void SetUp() override
  21. {}
  22. void TearDown() override
  23. {}
  24. };
  25. TEST_F(SectionPairFileReaderParameterTest, getDocument)
  26. {
  27. ASSERT_TRUE(SectionPairFileReaderParameter{}.getDocument() == nullptr);
  28. }
  29. TEST_F(SectionPairFileReaderParameterTest, getFileExistenceEvaluator)
  30. {
  31. ASSERT_TRUE(SectionPairFileReaderParameter{}.getFileExistenceEvaluator() == nullptr);
  32. }
  33. TEST_F(SectionPairFileReaderParameterTest, getFilePath)
  34. {
  35. ASSERT_TRUE(SectionPairFileReaderParameter{}.getFilePath().empty());
  36. }
  37. TEST_F(SectionPairFileReaderParameterTest, getReader)
  38. {
  39. ASSERT_TRUE(SectionPairFileReaderParameter{}.getReader() == nullptr);
  40. }
  41. TEST_F(SectionPairFileReaderParameterTest, setDocument)
  42. {
  43. SectionPairFileReaderParameter parameter{};
  44. parameter.setDocument(make_shared<SectionPairDocument>());
  45. ASSERT_FALSE(parameter.getDocument() == nullptr);
  46. }
  47. TEST_F(SectionPairFileReaderParameterTest, setFileExistenceEvaluator)
  48. {
  49. SectionPairFileReaderParameter parameter{};
  50. parameter.setFileExistenceEvaluator(make_shared<FileExistenceEvaluator>("/var/log/file.txt"));
  51. ASSERT_FALSE(parameter.getFileExistenceEvaluator() == nullptr);
  52. }
  53. TEST_F(SectionPairFileReaderParameterTest, setFilePath)
  54. {
  55. SectionPairFileReaderParameter parameter{};
  56. parameter.setFilePath("var/log/log.txt");
  57. ASSERT_FALSE(parameter.getFilePath().empty());
  58. }
  59. }