Skip to content

Conversation

@vladyslavkv
Copy link

No description provided.

const unsigned short g_linesInDigit = 3;
struct Digit
{
bool operator ==(const Digit& digit)
Copy link
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)

unsigned long long ConvertDigit(Digit digit)
{
if (digit == s_digit0)
static const Digit allDigits[] = { s_digit0, s_digit1, s_digit2,
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

result += ConvertDigit(digit) * std::pow(10, digitNumber);
}
return 000000000;
return result;
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

TEST(BankOcr, ConvertDisplay1)
TEST(BankOcr, ConvertDisplay0)
{
EXPECT_EQ(ConvertDisplay(s_displayAll0), 000000000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

TEST(BankOcr, ConvertDisplay0)
{
EXPECT_EQ(ConvertDisplay(s_displayAll0), 000000000);
// EXPECT_EQ(ConvertDisplay(s_displayAll0), 000000000);
Copy link
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