EventHandlerTest.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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-04
  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. {
  30. try
  31. {
  32. EventHandler eventHandler{""};
  33. }
  34. catch (const IllegalArgumentException &_exception)
  35. {
  36. throw;
  37. }
  38. },
  39. IllegalArgumentException);
  40. }
  41. TEST_F(EventHandlerTest, getId)
  42. {
  43. EventHandler eventHandler{"EventId"};
  44. ASSERT_STREQ("EventId", eventHandler.getId().c_str());
  45. }
  46. }