-
Notifications
You must be signed in to change notification settings - Fork 16
Dz3 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Dz3 #11
Conversation
| const unsigned short g_linesInDigit = 3; | ||
| struct Digit | ||
| { | ||
| bool operator ==(const Digit& digit) |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
во время рефакторинга тесты должны быть работоспособные
No description provided.