Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add isInSame<Second/Minute/Hour>WindowAs assertions #8

Closed
joel-costigliola opened this issue Mar 20, 2013 · 0 comments
Closed

add isInSame<Second/Minute/Hour>WindowAs assertions #8

joel-costigliola opened this issue Mar 20, 2013 · 0 comments
Labels
theme: documentation An issue related to documentation type: improvement A general improvement
Milestone

Comments

@joel-costigliola
Copy link
Member

We want to perform a true chronological comparison and not a field by field comparison.

Let's see that on an example :

Date date = parseDatetime("2003-04-26T13:01:02"); // 0 ms
Date dateMinusOneMs = new Date(date.getTime() - 1);
// This assertion should not fail as dates time difference is only 1ms.
assertThat(date).isInSameSecondWindowAs(dateMinusOneMs); 

Also clean isInSameXXXAs javadoc to make clear that they don't perform a true chronological comparison.

@scordio scordio added theme: documentation An issue related to documentation and removed documentation labels Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: documentation An issue related to documentation type: improvement A general improvement
Projects
None yet
Development

No branches or pull requests

2 participants