forked from eatvio/eatvio_app
feat(dependencies): add rxdart package and improve string extension methods for better handling of empty strings and gender parsing
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user