EventHandlerTest.cpp 1.1 KB

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