test(persistence): add tests for connection event dao

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-03-16 15:51:41 +05:30
parent 083ca28283
commit edc8c4d181
5 changed files with 202 additions and 65 deletions
@@ -0,0 +1,26 @@
import 'package:test/test.dart';
import 'package:meta/meta.dart';
Matcher isSameDateAs(DateTime targetDate) =>
_IsSameDateAs(targetDate: targetDate);
class _IsSameDateAs extends Matcher {
const _IsSameDateAs({
@required this.targetDate,
}) : assert(targetDate != null, '');
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');
}