forked from eatvio/eatvio_app
30 lines
689 B
Dart
30 lines
689 B
Dart
import 'package:eatvio_app/features/diary/models/get_day_model.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
group('GetDayModel', () {
|
|
test('fromJson parses day correctly', () {
|
|
final json = {'day': '2024-01-15'};
|
|
|
|
final model = GetDayModel.fromJson(json);
|
|
|
|
expect(model.day, '2024-01-15');
|
|
});
|
|
|
|
test('toJson serializes day correctly', () {
|
|
final model = GetDayModel(day: '2024-01-15');
|
|
|
|
final json = model.toJson();
|
|
|
|
expect(json['day'], '2024-01-15');
|
|
});
|
|
|
|
test('creates instance with day', () {
|
|
final model = GetDayModel(day: '2024-12-31');
|
|
|
|
expect(model.day, '2024-12-31');
|
|
});
|
|
});
|
|
}
|
|
|