-
-
Save SDiamante13/d742e78bc11b2a936f9766258a2bdce3 to your computer and use it in GitHub Desktop.
Do the simplest thing. Check if year is 1996.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package tech.pathtoprogramming.tdd; | |
| import org.junit.jupiter.api.Test; | |
| import static org.assertj.core.api.Assertions.assertThat; | |
| class AYearShould { | |
| @Test | |
| void determineThatTheYearIsNotALeapYearForCommonCase() { | |
| boolean isLeapYear = Year.isLeapYear(2001); | |
| assertThat(isLeapYear).isFalse(); | |
| } | |
| @Test | |
| void determineThatTheYearIsAStandardLeapYear() { | |
| boolean isLeapYear = Year.isLeapYear(1996); | |
| assertThat(isLeapYear).isTrue(); | |
| } | |
| } | |
| class Year { | |
| public static boolean isLeapYear(int year) { | |
| if (year == 1996) { | |
| return true; | |
| } | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment