refactored namespaces and added driverfactory
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
using namespace fakeit;
|
||||
using namespace Input;
|
||||
using namespace FlippR_Driver::Input;
|
||||
|
||||
|
||||
SCENARIO("Creating a Detector object", "")
|
||||
|
||||
@@ -25,15 +25,15 @@ SCENARIO("An EventHandler gets created", "[construction}")
|
||||
{
|
||||
LoggerFactory::CreateInputTestLogger();
|
||||
|
||||
Mock<Input::IInputDriver> input_driver_mock;
|
||||
Mock<FlippR_Driver::Input::IInputDriver> input_driver_mock;
|
||||
Fake(Dtor(input_driver_mock));
|
||||
When(Method(input_driver_mock, register_event_handler)).AlwaysReturn();
|
||||
When(Method(input_driver_mock, unregister_event_handler)).AlwaysReturn();
|
||||
|
||||
WHEN("the event handler gets created")
|
||||
{
|
||||
std::shared_ptr<Input::IInputDriver> driver_ptr(&input_driver_mock.get());
|
||||
Input::EventHandler handler(driver_ptr);
|
||||
std::shared_ptr<FlippR_Driver::Input::IInputDriver> driver_ptr(&input_driver_mock.get());
|
||||
FlippR_Driver::Input::EventHandler handler(driver_ptr);
|
||||
|
||||
THEN("It should register itself at the input_driver")
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "input/EventNotifier.h"
|
||||
|
||||
using namespace Input;
|
||||
using namespace FlippR_Driver::Input;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("An EventNotifier gets created", "[construction]")
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
|
||||
using namespace fakeit;
|
||||
using namespace Input;
|
||||
using namespace FlippR_Driver::Input;
|
||||
|
||||
SCENARIO("An InputDriver gets created", "[construction}")
|
||||
{
|
||||
@@ -56,14 +56,14 @@ SCENARIO("An EventHandler [un]registers at the driver", "[un-register]")
|
||||
{
|
||||
LoggerFactory::CreateInputTestLogger();
|
||||
|
||||
Mock<Input::IDetector> detector_mock;
|
||||
Mock<FlippR_Driver::Input::IDetector> detector_mock;
|
||||
Fake(Dtor(detector_mock));
|
||||
|
||||
Mock<IEventHandler> event_handler_mock;
|
||||
Fake(Method(event_handler_mock, handle));
|
||||
Fake(Dtor(event_handler_mock));
|
||||
|
||||
Mock<Input::IEventNotifier> event_notifier_mock;
|
||||
Mock<FlippR_Driver::Input::IEventNotifier> event_notifier_mock;
|
||||
Fake(Method(event_notifier_mock, register_event_handler));
|
||||
Fake(Method(event_notifier_mock, unregister_event_handler));
|
||||
Fake(Dtor(event_notifier_mock));
|
||||
@@ -103,13 +103,13 @@ SCENARIO("An Input Driver is created normally", "")
|
||||
{
|
||||
LoggerFactory::CreateInputTestLogger();
|
||||
|
||||
Mock<Input::IDetector> detector_mock;
|
||||
Mock<FlippR_Driver::Input::IDetector> detector_mock;
|
||||
Fake(Dtor(detector_mock));
|
||||
|
||||
Mock<IEventHandler> event_handler_mock;
|
||||
Fake(Dtor(event_handler_mock));
|
||||
|
||||
Mock<Input::IEventNotifier> event_notifier_mock;
|
||||
Mock<FlippR_Driver::Input::IEventNotifier> event_notifier_mock;
|
||||
Fake(Dtor(event_notifier_mock));
|
||||
|
||||
std::shared_ptr<IEventNotifier> event_notifier_ptr(&event_notifier_mock.get());
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "input/EventNotifier.h"
|
||||
|
||||
using namespace Input;
|
||||
using namespace FlippR_Driver::Input;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("The factory creates a InputDriver")
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_
|
||||
#define SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
class EventHandler;
|
||||
class Event;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_
|
||||
#define SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
class EventNotifier;
|
||||
class EventHandler;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_
|
||||
#define SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
class InputDriver;
|
||||
class EventHandler;
|
||||
|
||||
Reference in New Issue
Block a user