Skip to content
8 changes: 8 additions & 0 deletions tdd_intro/homework/01_leap_year/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ TEST(LeapYear, DivisibleBy4ExceptDivisibleBy100UnlessDivisibleBy400)
{
ASSERT_TRUE(IsLeapYear(2000));
}

TEST(LeapYear, Acceptence)
Copy link
Collaborator

Choose a reason for hiding this comment

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

перед этим тестом не хватило рефакторинга, функция в итоге может быть такой
return (year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);

{
ASSERT_TRUE(IsLeapYear(2020));
ASSERT_TRUE(IsLeapYear(2008));
ASSERT_FALSE(IsLeapYear(1990));
ASSERT_FALSE(IsLeapYear(1000));
}