MockFileExistenceEvaluator.cpp 945 B

1234567891011121314151617181920212223242526272829303132
  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-21
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #include "MockFileExistenceEvaluator.hpp"
  11. #include <ls-std/core/exception/FileNotFoundException.hpp>
  12. #include <string>
  13. using ls::standard::core::Class;
  14. using ls::standard::core::FileNotFoundException;
  15. using std::string;
  16. using test::io::MockFileExistenceEvaluator;
  17. MockFileExistenceEvaluator::MockFileExistenceEvaluator(const bool _fileExists) : Class("MockFileExistenceEvaluator"), fileExists(_fileExists)
  18. {}
  19. MockFileExistenceEvaluator::~MockFileExistenceEvaluator() noexcept = default;
  20. void MockFileExistenceEvaluator::evaluate()
  21. {
  22. if (!this->fileExists)
  23. {
  24. const string message = this->getClassName() + " called - this is just a simulation!";
  25. throw FileNotFoundException{message};
  26. }
  27. }