Skip to content

Commit

Permalink
Revert changes to date time adapter test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Sep 18, 2024
1 parent bfcc0dd commit acae470
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions hive/test/tests/adapters/date_time_adapter_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This is a test
// ignore_for_file: prefer_timestamps
import 'package:hive_ce/src/adapters/date_time_adapter.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';
Expand All @@ -7,7 +9,7 @@ import '../mocks.dart';
void main() {
group('DateTimeAdapter', () {
test('.read()', () {
final now = DateTime.timestamp();
final now = DateTime.now();
final binaryReader = MockBinaryReader();
when(binaryReader.readInt).thenReturn(now.millisecondsSinceEpoch);

Expand All @@ -17,7 +19,7 @@ void main() {
});

test('.write()', () {
final now = DateTime.timestamp();
final now = DateTime.now();
final binaryWriter = MockBinaryWriter();

DateTimeAdapter().write(binaryWriter, now);
Expand All @@ -28,7 +30,7 @@ void main() {
group('DateTimeWithTimezoneAdapter', () {
group('.read()', () {
test('local', () {
final now = DateTime.timestamp();
final now = DateTime.now();
final binaryReader = MockBinaryReader();
when(binaryReader.readInt).thenReturn(now.millisecondsSinceEpoch);
when(binaryReader.readBool).thenReturn(false);
Expand All @@ -42,7 +44,7 @@ void main() {
});

test('UTC', () {
final now = DateTime.timestamp().toUtc();
final now = DateTime.now().toUtc();
final binaryReader = MockBinaryReader();
when(binaryReader.readInt).thenReturn(now.millisecondsSinceEpoch);
when(binaryReader.readBool).thenReturn(true);
Expand All @@ -59,7 +61,7 @@ void main() {

group('.write()', () {
test('local', () {
final now = DateTime.timestamp();
final now = DateTime.now();
final binaryWriter = MockBinaryWriter();

DateTimeWithTimezoneAdapter().write(binaryWriter, now);
Expand All @@ -70,7 +72,7 @@ void main() {
});

test('UTC', () {
final now = DateTime.timestamp().toUtc();
final now = DateTime.now().toUtc();
final binaryWriter = MockBinaryWriter();

DateTimeWithTimezoneAdapter().write(binaryWriter, now);
Expand Down

0 comments on commit acae470

Please sign in to comment.