EventNotSubscribedExceptionTest.cpp 1.0 KB

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