Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unit tests with dates 5
@Test
public void should_return_false_when_today_isnt_the_birthday_of_user() throws Exception {
User user = new User().setDateOfBirth(five_july_2000);
Date today = six_july_2010;
assertThat(user.isBirthDay(today), is(false));
}
@Test
public void should_return_true_when_today_is_the_birthday_of_user() throws Exception {
User user = new User().setDateOfBirth(five_july_2000);
Date today = five_july_2010;
assertThat(user.isBirthDay(today), is(true));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment