forked from eatvio/eatvio_app
32 lines
802 B
Dart
32 lines
802 B
Dart
import 'package:eatvio_app/features/diary/models/create_day_model.dart';
|
||
import 'package:flutter_test/flutter_test.dart';
|
||
|
||
void main() {
|
||
group('CreateDayModel', () {
|
||
test('создает CreateDayModel с правильными значениями', () {
|
||
final model = CreateDayModel(day: '2024-01-01');
|
||
|
||
expect(model.day, '2024-01-01');
|
||
});
|
||
|
||
test('fromJson создает CreateDayModel из JSON', () {
|
||
final json = {
|
||
'day': '2024-01-01',
|
||
};
|
||
|
||
final model = CreateDayModel.fromJson(json);
|
||
|
||
expect(model.day, '2024-01-01');
|
||
});
|
||
|
||
test('toJson serializes CreateDayModel correctly', () {
|
||
final model = CreateDayModel(day: '2024-01-01');
|
||
|
||
final json = model.toJson();
|
||
|
||
expect(json['day'], '2024-01-01');
|
||
});
|
||
});
|
||
}
|
||
|