EventNotHandledExceptionTest.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2021-05-27
  6. * Changed: 2022-05-13
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std_core.hpp>
  11. namespace
  12. {
  13. class EventNotHandledExceptionTest : public ::testing::Test
  14. {
  15. protected:
  16. EventNotHandledExceptionTest() = default;
  17. ~EventNotHandledExceptionTest() override = default;
  18. void SetUp() override
  19. {}
  20. void TearDown() override
  21. {}
  22. };
  23. TEST_F(EventNotHandledExceptionTest, constructor)
  24. {
  25. EXPECT_THROW({
  26. try
  27. {
  28. throw ls::std::core::EventNotHandledException{};
  29. }
  30. catch (const ls::std::core::EventNotHandledException &_exception)
  31. {
  32. EXPECT_STREQ("EventNotHandledException thrown - event was not handled - nothing happened!", _exception.what());
  33. throw;
  34. }
  35. }, ls::std::core::EventNotHandledException);
  36. }
  37. }