EventHandlerTest.cpp 1.0 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: 2023-03-25
  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 ls::std::core::IllegalArgumentException;
  13. using ls::std::event::EventHandler;
  14. using testing::Test;
  15. namespace
  16. {
  17. class EventHandlerTest : public Test
  18. {
  19. public:
  20. EventHandlerTest() = default;
  21. ~EventHandlerTest() override = default;
  22. };
  23. TEST_F(EventHandlerTest, constructor_empty_parameter)
  24. {
  25. EXPECT_THROW(
  26. {
  27. try
  28. {
  29. EventHandler eventHandler{""};
  30. }
  31. catch (const IllegalArgumentException &_exception)
  32. {
  33. throw;
  34. }
  35. },
  36. IllegalArgumentException);
  37. }
  38. TEST_F(EventHandlerTest, getId)
  39. {
  40. EventHandler eventHandler{"EventId"};
  41. ASSERT_STREQ("EventId", eventHandler.getId().c_str());
  42. }
  43. }