First test rdy

This commit is contained in:
Jonas Zeunert
2018-06-27 21:11:05 +02:00
parent 41599feb88
commit 05b116ff2f
2 changed files with 30 additions and 16 deletions

View File

@@ -7,10 +7,11 @@
#include "../catch.hpp"
#include "../fakeit.hpp"
#include "../../src/utilities/LoggerFactory.hpp"
// testing purposes
#define private public
#include "../../src/utilities/LoggerFactory.hpp"
#include "../../src/input/InputDriver.h"
#include "../../src/input/IEventNotifier.h"
@@ -21,7 +22,7 @@ using namespace fakeit;
SCENARIO("An InputDriver gets created", "[construction}")
{
GIVEN("An EventNotifier")
GIVEN("An EventNotifier and a Detector")
{
LoggerFactory::CreateInputLogger();
@@ -32,14 +33,14 @@ SCENARIO("An InputDriver gets created", "[construction}")
Fake(Dtor(event_notifier_mock));
Mock<IEventHandler> event_handler_mock;
Fake(Dtor(event_handler_mock));
WHEN("The InputDriver gets created")
{
Input::InputDriver input_driver(&event_notifier_mock.get(), &detector_mock.get());
THEN("It saved the EventNotifier")
THEN("It saves the EventNotifier and the Detector")
{
REQUIRE(input_driver.event_notifier == &event_notifier_mock.get());
REQUIRE(input_driver.detector == &detector_mock.get());
}
}
}