SectionPairFileReaderParameterTest.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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-22
  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. using namespace ::testing;
  14. namespace
  15. {
  16. class SectionPairFileReaderParameterTest : public Test
  17. {
  18. protected:
  19. SectionPairFileReaderParameterTest() = default;
  20. ~SectionPairFileReaderParameterTest() override = default;
  21. void SetUp() override
  22. {}
  23. void TearDown() override
  24. {}
  25. };
  26. TEST_F(SectionPairFileReaderParameterTest, getDocument)
  27. {
  28. ASSERT_TRUE(SectionPairFileReaderParameter{}.getDocument() == nullptr);
  29. }
  30. TEST_F(SectionPairFileReaderParameterTest, getFileExistenceEvaluator)
  31. {
  32. ASSERT_TRUE(SectionPairFileReaderParameter{}.getFileExistenceEvaluator() == nullptr);
  33. }
  34. TEST_F(SectionPairFileReaderParameterTest, getFilePath)
  35. {
  36. ASSERT_TRUE(SectionPairFileReaderParameter{}.getFilePath().empty());
  37. }
  38. TEST_F(SectionPairFileReaderParameterTest, getReader)
  39. {
  40. ASSERT_TRUE(SectionPairFileReaderParameter{}.getReader() == nullptr);
  41. }
  42. TEST_F(SectionPairFileReaderParameterTest, setDocument)
  43. {
  44. SectionPairFileReaderParameter parameter{};
  45. parameter.setDocument(make_shared<SectionPairDocument>());
  46. ASSERT_FALSE(parameter.getDocument() == nullptr);
  47. }
  48. TEST_F(SectionPairFileReaderParameterTest, setFileExistenceEvaluator)
  49. {
  50. SectionPairFileReaderParameter parameter{};
  51. parameter.setFileExistenceEvaluator(make_shared<FileExistenceEvaluator>("/var/log/file.txt"));
  52. ASSERT_FALSE(parameter.getFileExistenceEvaluator() == nullptr);
  53. }
  54. TEST_F(SectionPairFileReaderParameterTest, setFilePath)
  55. {
  56. SectionPairFileReaderParameter parameter{};
  57. parameter.setFilePath("var/log/log.txt");
  58. ASSERT_FALSE(parameter.getFilePath().empty());
  59. }
  60. }