-
-
Save kikers25/60599a828b5765740e6ad645dd1fdabb to your computer and use it in GitHub Desktop.
Unit tests with dates 7
This file contains 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
@Test | |
public void should_return_false_when_today_isnt_the_birthday_of_user() throws Exception { | |
User user = new User() { | |
@Override | |
protected Date getDate() { | |
return six_july_2010; | |
} | |
}; | |
user.setDateOfBirth(five_july_2000); | |
assertThat(user.isBirthDay(), is(false)); | |
} | |
@Test | |
public void should_return_true_when_today_is_the_birthday_of_user() throws Exception { | |
User user = new User() { | |
@Override | |
protected Date getDate() { | |
return five_july_2010; | |
} | |
}; | |
user.setDateOfBirth(five_july_2000); | |
assertThat(user.isBirthDay(), is(true)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment