EventHandlerTest.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-27
  6. * Changed: 2022-05-14
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std_core.hpp>
  11. #include <ls_std/ls_std_event.hpp>
  12. namespace
  13. {
  14. class EventHandlerTest : public ::testing::Test
  15. {
  16. protected:
  17. EventHandlerTest() = default;
  18. ~EventHandlerTest() override = default;
  19. void SetUp() override
  20. {}
  21. void TearDown() override
  22. {}
  23. };
  24. TEST_F(EventHandlerTest, constructor_empty_parameter)
  25. {
  26. EXPECT_THROW({
  27. try
  28. {
  29. ls::std::event::EventHandler eventHandler{""};
  30. }
  31. catch (const ls::std::core::IllegalArgumentException &_exception)
  32. {
  33. throw;
  34. }
  35. }, ls::std::core::IllegalArgumentException);
  36. }
  37. TEST_F(EventHandlerTest, getId)
  38. {
  39. ls::std::event::EventHandler eventHandler{"EventId"};
  40. ASSERT_STREQ("EventId", eventHandler.getId().c_str());
  41. }
  42. }