EventHandlerTest.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-11-27
  6. * Changed: 2023-02-22
  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. protected:
  20. EventHandlerTest() = default;
  21. ~EventHandlerTest() override = default;
  22. void SetUp() override
  23. {}
  24. void TearDown() override
  25. {}
  26. };
  27. TEST_F(EventHandlerTest, constructor_empty_parameter)
  28. {
  29. EXPECT_THROW(
  30. {
  31. try
  32. {
  33. EventHandler eventHandler{""};
  34. }
  35. catch (const IllegalArgumentException &_exception)
  36. {
  37. throw;
  38. }
  39. },
  40. IllegalArgumentException);
  41. }
  42. TEST_F(EventHandlerTest, getId)
  43. {
  44. EventHandler eventHandler{"EventId"};
  45. ASSERT_STREQ("EventId", eventHandler.getId().c_str());
  46. }
  47. }