isCloseTo function

Matcher isCloseTo(
  1. DateTime expectedDateTime, {
  2. int days = 0,
  3. int hours = 0,
  4. int minutes = 0,
  5. int seconds = 0,
  6. int milliseconds = 0,
  7. int microseconds = 0,
})

Implementation

Matcher isCloseTo(DateTime expectedDateTime,
    {int days = 0,
    int hours = 0,
    int minutes = 0,
    int seconds = 0,
    int milliseconds = 0,
    int microseconds = 0}) {
  final closeDuration = Duration(
          days: days,
          hours: hours,
          minutes: minutes,
          seconds: seconds,
          milliseconds: milliseconds,
          microseconds: microseconds)
      .abs();
  return _IsDateTimeCloseTo(
    expectedDateTime,
    closeDuration,
  );
}