Skip to content

Conversation

@Alexandr1992
Copy link

No description provided.

@Alexandr1992 Alexandr1992 changed the title Leap Year 01-Leap Year Oct 31, 2018
Copy link
Collaborator

@mettizik mettizik left a comment

Choose a reason for hiding this comment

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

Всё отлично, немного не хватило рефакторинга в конце (это опционально в данном случае - на вкус и цвет), но обилие if'ов и return'ов усложняет функцию для сопровождения. От последнего ифа можно было спокойно избавиться переместив его условие в ретурн:

  return isDivisable(year, 4);

{
EXPECT_TRUE(IsLeapYear(g_fourHundred));
EXPECT_TRUE(IsLeapYear(g_fourHundred * 2));
EXPECT_TRUE(IsLeapYear(g_fourHundred * 3));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Отличное дополнение теста 👍 (но название немного портит картину ))

}

TEST(LeapYear, Test400)
TEST(LeapYear, TestDivisible400)
Copy link
Collaborator

Choose a reason for hiding this comment

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

не хватает непосредственно ожидания - понятно, что он проверяет кратность 400, но непонятно что должно стать с таким числом - каково ожидаемое поведение

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.

4 participants