@@ -3,8 +3,7 @@ import 'package:drift/drift.dart';
|
||||
import 'package:stream_chat_persistence/src/converter/list_converter.dart';
|
||||
import 'package:stream_chat_persistence/src/converter/map_converter.dart';
|
||||
import 'package:stream_chat_persistence/src/converter/message_sending_status_converter.dart';
|
||||
|
||||
import 'channels.dart';
|
||||
import 'package:stream_chat_persistence/src/entity/channels.dart';
|
||||
|
||||
/// Represents a [Messages] table in [MoorChatDatabase].
|
||||
@DataClassName('MessageEntity')
|
||||
|
||||
@@ -17,14 +17,15 @@ void main() {
|
||||
});
|
||||
|
||||
test(
|
||||
'should throw type error if the provided json is not a list of String',
|
||||
() {
|
||||
final json = [22, 33, 44];
|
||||
expect(
|
||||
() => listConverter.fromSql(jsonEncode(json)),
|
||||
throwsA(isA<TypeError>()),
|
||||
);
|
||||
});
|
||||
'should throw type error if the provided json is not a list of String',
|
||||
() {
|
||||
final json = [22, 33, 44];
|
||||
expect(
|
||||
() => listConverter.fromSql(jsonEncode(json)),
|
||||
throwsA(isA<TypeError>()),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
test('should return list of String if json data list is provided', () {
|
||||
final data = ['data1', 'data2', 'data3'];
|
||||
@@ -60,14 +61,15 @@ void main() {
|
||||
});
|
||||
|
||||
test(
|
||||
'should throw type error if the provided json is not a list of String',
|
||||
() {
|
||||
final json = [22, 33, 44];
|
||||
expect(
|
||||
() => listConverter.fromSql(jsonEncode(json)),
|
||||
throwsA(isA<TypeError>()),
|
||||
);
|
||||
});
|
||||
'should throw type error if the provided json is not a list of String',
|
||||
() {
|
||||
final json = [22, 33, 44];
|
||||
expect(
|
||||
() => listConverter.fromSql(jsonEncode(json)),
|
||||
throwsA(isA<TypeError>()),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
test('should return list of String if json data list is provided', () {
|
||||
final data = ['data1', 'data2', 'data3'];
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stream_chat_persistence/src/db/drift_chat_database.dart';
|
||||
|
||||
DatabaseConnection _backgroundConnection() =>
|
||||
DatabaseConnection.fromExecutor(NativeDatabase.memory());
|
||||
DatabaseConnection(NativeDatabase.memory());
|
||||
|
||||
void main() {
|
||||
test(
|
||||
|
||||
Reference in New Issue
Block a user