forked from eatvio/eatvio_app
62 lines
1.7 KiB
Dart
62 lines
1.7 KiB
Dart
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);
|
||
});
|
||
});
|
||
}
|
||
|