feat(dependencies): add rxdart package and improve string extension methods for better handling of empty strings and gender parsing

This commit is contained in:
mso7nueh
2025-12-04 15:45:54 +03:00
parent 0cd8e662d9
commit 953230b387
100 changed files with 7202 additions and 14 deletions

View File

@@ -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);
});
});
}