chore: Move the drift_offline_first to legacy in favor of Serverpod implementation (#32)
This commit is contained in:
parent
027aec5ed0
commit
cbc472523b
1 changed files with 13575 additions and 284 deletions
27
legacy/drift_offline_sync/test/hlc/hlc_converter_test.dart
Normal file
27
legacy/drift_offline_sync/test/hlc/hlc_converter_test.dart
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import 'package:drift_offline_sync/drift_offline_sync.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
const _isoTime = '2001-09-09T01:46:40.000Z';
|
||||
final _dateTime = DateTime.parse(_isoTime);
|
||||
|
||||
void main() {
|
||||
test('Given an HLC and the HlcConverter '
|
||||
'when converting to the database format '
|
||||
'then it returns string with padded unix timestamp.', () {
|
||||
final hlc = Hlc(_dateTime, 0x17, 'abc');
|
||||
|
||||
expect(
|
||||
hlcConverter.toSql(hlc),
|
||||
'${_dateTime.millisecondsSinceEpoch.toString().padLeft(15, '0')}-0017-abc',
|
||||
);
|
||||
});
|
||||
|
||||
test('Given an HLC and the HlcConverter '
|
||||
'when converting from the database format '
|
||||
'then it returns the equivalent HLC.', () {
|
||||
final hlc = Hlc(_dateTime, 0x17, 'abc');
|
||||
final databaseHlc = hlcConverter.toSql(hlc);
|
||||
|
||||
expect(hlcConverter.fromSql(databaseHlc), hlc);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue