test(persistence): add tests for connection event dao
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -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');
|
||||
}
|
||||
Reference in New Issue
Block a user