Skip to content

Instantly share code, notes, and snippets.

@bartubozkurt
Created November 21, 2021 23:05
Show Gist options
  • Save bartubozkurt/7368829b7d49611b5c21e7629203813c to your computer and use it in GitHub Desktop.
Save bartubozkurt/7368829b7d49611b5c21e7629203813c to your computer and use it in GitHub Desktop.
public class LeapYearTests {
private final LeapYear leapYear = new LeapYear();
@Test
public void divisibleBy4_notDivisibleBy100() {
boolean leap = leapYear.isLeapYear(2016);
assertTrue(leap);
}
@Test
public void divisibleBy4_100_400() {
boolean leap = leapYear.isLeapYear(2000);
assertTrue(leap);
}
@Test
public void notDivisibleBy4() {
boolean leap = leapYear.isLeapYear(39);
assertFalse(leap);
}
@Test
public void divisibleBy4_and_100_not_400() {
boolean leap = leapYear.isLeapYear(1900);
assertFalse(leap);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment