/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2024-05-16 * Changed: 2024-05-17 * * */ #include #include #include #include #include using ls::std::core::NullPointerException; using ls::std::event::EventListener; using ls::std::event::EventManager; using ::std::make_shared; using ::std::string; using test::event::Button; using test::event::OnClickEvent; using testing::Test; namespace { class EventListenerTest : public Test { public: EventListenerTest() = default; ~EventListenerTest() override = default; }; TEST_F(EventListenerTest, getClassName) { ASSERT_STREQ("EventListener", EventListener().getClassName().c_str()); } TEST_F(EventListenerTest, getId) { ASSERT_EQ(0, EventListener().getId()); } TEST_F(EventListenerTest, setId) { auto listener = EventListener(); ASSERT_EQ(0, listener.getId()); listener.setId(17); ASSERT_EQ(17, listener.getId()); } TEST_F(EventListenerTest, subscribe_with_missing_event_manager) { auto myButton = make_shared