Files
eatvio_app/test/features/diary/models/consultant_comment_model_test.dart

62 lines
1.7 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:eatvio_app/features/diary/models/consultant_comment_model.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('ConsultantCommentModel', () {
test('создает ConsultantCommentModel с дефолтными значениями', () {
final model = ConsultantCommentModel();
expect(model.comment, isNull);
expect(model.mealsComments, isEmpty);
expect(model.portions, isEmpty);
});
test('создает ConsultantCommentModel с комментариями', () {
final model = ConsultantCommentModel(
comment: 'General comment',
mealsComments: {
'breakfast': MealCommentModel(
comment: 'Breakfast comment',
typeNumber: 1,
),
},
portions: [
PortionCommentModel(
comment: 'Portion comment',
id: 1,
),
],
);
expect(model.comment, 'General comment');
expect(model.mealsComments.length, 1);
expect(model.portions.length, 1);
});
});
group('MealCommentModel', () {
test('создает MealCommentModel с правильными значениями', () {
final model = MealCommentModel(
comment: 'Test comment',
typeNumber: 1,
);
expect(model.comment, 'Test comment');
expect(model.typeNumber, 1);
});
});
group('PortionCommentModel', () {
test('создает PortionCommentModel с правильными значениями', () {
final model = PortionCommentModel(
comment: 'Portion comment',
id: 1,
);
expect(model.comment, 'Portion comment');
expect(model.id, 1);
});
});
}