EventHandlerTest.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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-09
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls_std/ls_std.hpp>
  11. namespace
  12. {
  13. class EventHandlerTest : public ::testing::Test
  14. {
  15. protected:
  16. EventHandlerTest() = default;
  17. ~EventHandlerTest() override = default;
  18. void SetUp() override
  19. {}
  20. void TearDown() override
  21. {}
  22. };
  23. TEST_F(EventHandlerTest, constructor_empty_parameter)
  24. {
  25. EXPECT_THROW({
  26. try
  27. {
  28. ls::std::event::EventHandler eventHandler{""};
  29. }
  30. catch (const ls::std::core::IllegalArgumentException &_exception)
  31. {
  32. throw;
  33. }
  34. }, ls::std::core::IllegalArgumentException);
  35. }
  36. TEST_F(EventHandlerTest, getId)
  37. {
  38. ls::std::event::EventHandler eventHandler{"EventId"};
  39. ASSERT_STREQ("EventId", eventHandler.getId().c_str());
  40. }
  41. }