wrote display stuff and refactored thousend things
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "output/CabinetItem.h"
|
||||
|
||||
using namespace output;
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("")
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
@@ -19,11 +19,47 @@
|
||||
|
||||
#include "output/Display.h"
|
||||
|
||||
using namespace output;
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("")
|
||||
SCENARIO("Creating a Display object", "")
|
||||
{
|
||||
GIVEN("Just a Display with 7 digits")
|
||||
{
|
||||
Display<7> display(5,5);
|
||||
WHEN("A content is set for the display")
|
||||
{
|
||||
std::string content_string = "1234567";
|
||||
std::array<char,7> content;
|
||||
std::copy(content_string.begin(), content_string.end(), content.data());
|
||||
display.write_content(content);
|
||||
THEN("This content should be set for the display")
|
||||
{
|
||||
REQUIRE(content == display.content);
|
||||
}
|
||||
}
|
||||
WHEN("A score (12345) within the size of the display is written")
|
||||
{
|
||||
display.write_score(12345);
|
||||
THEN("The content should look like: \" 12345\" ")
|
||||
{
|
||||
std::string content_string = " 12345";
|
||||
std::array<char,7> content;
|
||||
std::copy(content_string.begin(), content_string.end(), content.data());
|
||||
|
||||
REQUIRE(display.content == content);
|
||||
}
|
||||
}
|
||||
WHEN("A score (12345678), which is longer than the digit is written")
|
||||
display.write_score(12345678);
|
||||
THEN("The content should look like: \"2345678\" ")
|
||||
{
|
||||
std::string content_string = "2345678";
|
||||
std::array<char,7> content;
|
||||
std::copy(content_string.begin(), content_string.end(), content.data());
|
||||
|
||||
REQUIRE(display.content == content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "output/DisplayController.h"
|
||||
|
||||
using namespace output;
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("")
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "output/Lamp.h"
|
||||
|
||||
using namespace output;
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("")
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "output/OutputDriver.h"
|
||||
|
||||
using namespace output;
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("")
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "output/Solenoid.h"
|
||||
|
||||
using namespace output;
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("")
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "output/Sound.h"
|
||||
|
||||
using namespace output;
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("")
|
||||
|
||||
Reference in New Issue
Block a user