aaah
This commit is contained in:
@@ -27,7 +27,7 @@ using namespace Input;
|
||||
|
||||
SCENARIO("Creating a Detector object", "")
|
||||
{
|
||||
GIVEN("An IEventNofifier, two Events and an IInputGPIOInterface")
|
||||
GIVEN("An IEventNofifier, three Events and an IInputGPIOInterface")
|
||||
{
|
||||
LoggerFactory::CreateInputLogger();
|
||||
|
||||
|
||||
@@ -5,3 +5,40 @@
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
*/
|
||||
|
||||
#include "../catch.hpp"
|
||||
#include "../fakeit.hpp"
|
||||
|
||||
#include "../../src/utilities/LoggerFactory.hpp"
|
||||
#include "../../src/input/EventHandler.h"
|
||||
#include "../../src/input/IInputDriver.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
#define private public
|
||||
|
||||
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("An EventHandler gets created", "[construction}")
|
||||
{
|
||||
GIVEN("An IInputDriver")
|
||||
{
|
||||
LoggerFactory::CreateInputLogger();
|
||||
|
||||
Mock<Input::IInputDriver> input_driver_mock;
|
||||
Fake(Dtor(input_driver_mock));
|
||||
When(Method(input_driver_mock, register_event_handler)).AlwaysReturn();
|
||||
When(Method(input_driver_mock, operator=)).AlwaysReturn();
|
||||
|
||||
WHEN("the event handler gets created")
|
||||
{
|
||||
std::shared_ptr<Input::IInputDriver> driver_ptr(&input_driver_mock.get());
|
||||
Input::EventHandler handler(driver_ptr);
|
||||
|
||||
THEN("It should register itself at the input_driver")
|
||||
{
|
||||
REQUIRE((bool)Verify(Method(input_driver_mock, register_event_handler).Using(&handler)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user