forked from eatvio/eatvio_app
34 lines
776 B
Dart
34 lines
776 B
Dart
import 'package:eatvio_app/features/chat/models/chat_meta_model.dart';
|
||
import 'package:flutter_test/flutter_test.dart';
|
||
|
||
void main() {
|
||
group('ChatMetaModel', () {
|
||
test('создает ChatMetaModel с правильными значениями', () {
|
||
const model = ChatMetaModel(
|
||
lastPage: 5,
|
||
);
|
||
|
||
expect(model.lastPage, 5);
|
||
});
|
||
|
||
test('fromJson создает ChatMetaModel из JSON', () {
|
||
final json = {
|
||
'last_page': 5,
|
||
};
|
||
|
||
final model = ChatMetaModel.fromJson(json);
|
||
|
||
expect(model.lastPage, 5);
|
||
});
|
||
|
||
test('toJson serializes ChatMetaModel correctly', () {
|
||
const model = ChatMetaModel(lastPage: 5);
|
||
|
||
final json = model.toJson();
|
||
|
||
expect(json['last_page'], 5);
|
||
});
|
||
});
|
||
}
|
||
|