Merge branch 'master' of https://github.com/swinginbird/flippr-code
This commit is contained in:
@@ -59,20 +59,22 @@ SCENARIO("An EventHandler gets [un]registered at the notifier", "[un-register no
|
|||||||
|
|
||||||
THEN("The EventHandler gets saved")
|
THEN("The EventHandler gets saved")
|
||||||
{
|
{
|
||||||
REQUIRE(*(notifier.event_handlers.find(&event_handler_mock.get())) == &event_handler_mock.get());
|
|
||||||
REQUIRE_FALSE(notifier.event_handlers.empty() );
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
WHEN("The EventHandler gets unregistered at the driver")
|
AND_WHEN("The EventHandler gets unregistered at the driver")
|
||||||
{
|
|
||||||
notifier.unregister_event_handler(&event_handler_mock.get());
|
|
||||||
|
|
||||||
THEN("The unregister_event_handler at the event_notifier gets called")
|
|
||||||
{
|
{
|
||||||
REQUIRE(notifier.event_handlers.empty());
|
REQUIRE(!notifier.event_handler.empty());
|
||||||
|
|
||||||
|
notifier.unregister_event_handler(&event_handler_mock.get());
|
||||||
|
|
||||||
|
THEN("The list of event_handlers is empty")
|
||||||
|
{
|
||||||
|
REQUIRE(notifier.event_handler.empty());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +120,6 @@ SCENARIO("The EventHandler gets notified")
|
|||||||
Fake(Dtor(queue_mock));
|
Fake(Dtor(queue_mock));
|
||||||
|
|
||||||
EventNotifier notifier;
|
EventNotifier notifier;
|
||||||
|
|
||||||
notifier.event_queue = &(queue_mock.get());
|
notifier.event_queue = &(queue_mock.get());
|
||||||
notifier.event_handlers.insert(&(event_handler_mock.get()));
|
notifier.event_handlers.insert(&(event_handler_mock.get()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user