You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Datedate = parseDatetime("2003-04-26T13:01:02"); // 0 msDatedateMinusOneMs = newDate(date.getTime() - 1);
// The assertion below fails as seconds fields are different // even though dates difference is only 1ms// If we expect a chronological comparison then it should succeed// If we expect a field by field comparison then it fails as expectedassertThat(date).isInSameSecondAs(dateMinusOneMs);
I suggest to
rename isInSameSecondAs to isEqualToIgnoringMs
add new assertions for chronological comparison with isInSameSecondWindowAs
Datedate = parseDatetime("2003-04-26T13:01:02"); // 0 msDatedateMinusOneMs = newDate(date.getTime() - 1);
// should failassertThat(date).isEqualToIgnoringMilliseconds(dateMinusOneMs);
// should succeedassertThat(date).isInSameSecondWindowAs(dateMinusOneMs);
The text was updated successfully, but these errors were encountered:
Let's see that on an example :
I suggest to
isInSameSecondAs
toisEqualToIgnoringMs
isInSameSecondWindowAs
The text was updated successfully, but these errors were encountered: