Skip to content

Dz3#11

Open
vladyslavkv wants to merge 40 commits into
driverdevteam:masterfrom
vladyslavkv:Dz3
Open

Dz3#11
vladyslavkv wants to merge 40 commits into
driverdevteam:masterfrom
vladyslavkv:Dz3

Conversation

@vladyslavkv
Copy link
Copy Markdown

No description provided.

Comment thread tdd_intro/homework/03_bank_ocr/test.cpp Outdated
const unsigned short g_linesInDigit = 3;
struct Digit
{
bool operator ==(const Digit& digit)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Разработана не по ТДД
Нужны были тесты
EXPECT_TRUE(s_digit0 == s_digit0)
EXPECT_FALSE(s_digit0 == s_digit1)

Comment thread tdd_intro/homework/03_bank_ocr/test.cpp Outdated
unsigned long long ConvertDigit(Digit digit)
{
if (digit == s_digit0)
static const Digit allDigits[] = { s_digit0, s_digit1, s_digit2,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сейчас этот массив должен был содержать только те цифры, на которые есть тесты

Comment thread tdd_intro/homework/03_bank_ocr/test.cpp Outdated
result += ConvertDigit(digit) * std::pow(10, digitNumber);
}
return 000000000;
return result;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

перед переходом к циклу нужен был тест на случай, когда цикл не выполнится ни разу.

Comment thread tdd_intro/homework/03_bank_ocr/test.cpp Outdated
TEST(BankOcr, ConvertDisplay1)
TEST(BankOcr, ConvertDisplay0)
{
EXPECT_EQ(ConvertDisplay(s_displayAll0), 000000000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

странное ожидаемое значение "int 000000000"

Comment thread tdd_intro/homework/03_bank_ocr/test.cpp Outdated
TEST(BankOcr, ConvertDisplay0)
{
EXPECT_EQ(ConvertDisplay(s_displayAll0), 000000000);
// EXPECT_EQ(ConvertDisplay(s_displayAll0), 000000000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

во время рефакторинга тесты должны быть работоспособные

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants