refactored everything
This commit is contained in:
@@ -17,16 +17,16 @@
|
||||
// testing purposes
|
||||
#define private public
|
||||
|
||||
#include "output/Display.h"
|
||||
#include "Display.h"
|
||||
|
||||
using namespace FlippR_Driver::output;
|
||||
using namespace flippR_driver::output;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("Creating a Display object", "")
|
||||
{
|
||||
GIVEN("Just a Display with 7 digits")
|
||||
{
|
||||
Display<7> display(5,5);
|
||||
SevenDigitDisplay display(5,5);
|
||||
WHEN("A content is set for the display")
|
||||
{
|
||||
std::string content_string = "1234567";
|
||||
@@ -43,7 +43,7 @@ SCENARIO("Creating a Display object", "")
|
||||
display.write_score(12345);
|
||||
THEN("The content should look like: \" 12345\" ")
|
||||
{
|
||||
std::string content_string = " 12345";
|
||||
std::string content_string = "\0\012345";
|
||||
std::array<char,7> content;
|
||||
std::copy(content_string.begin(), content_string.end(), content.data());
|
||||
|
||||
@@ -51,14 +51,16 @@ SCENARIO("Creating a Display object", "")
|
||||
}
|
||||
}
|
||||
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());
|
||||
display.write_score(12345678);
|
||||
THEN("The content should look like: \"9999999\"-> highest number ")
|
||||
{
|
||||
std::string content_string = "9999999";
|
||||
std::array<char,7> content;
|
||||
std::copy(content_string.begin(), content_string.end(), content.data());
|
||||
|
||||
REQUIRE(display.content == content);
|
||||
REQUIRE(display.content == content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user