Files
stream-chat-flutter/packages/stream_chat_persistence/test/src/utils/date_matcher.dart
T
Sahil Kumar 3bb1b11ee8 migrate to nnbd
Signed-off-by: Sahil Kumar <[email protected]>
2021-04-20 19:52:06 +05:30

24 lines
668 B
Dart

import 'package:test/test.dart';
Matcher isSameDateAs(DateTime targetDate) =>
_IsSameDateAs(targetDate: targetDate);
class _IsSameDateAs extends Matcher {
const _IsSameDateAs({required this.targetDate});
final DateTime targetDate;
@override
bool matches(covariant DateTime date, Map matchState) =>
date.year == targetDate.year &&
date.month == targetDate.month &&
date.day == targetDate.day &&
date.hour == targetDate.hour &&
date.minute == targetDate.minute &&
date.second == targetDate.second;
@override
Description describe(Description description) =>
description.add('is same date as $targetDate');
}