forked from eatvio/eatvio_app
55 lines
1.7 KiB
Dart
55 lines
1.7 KiB
Dart
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
||
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
||
import 'package:eatvio_app/features/plans/enums/chosen_plan_state_enum.dart';
|
||
import 'package:eatvio_app/features/plans/models/chosen_plan_model.dart';
|
||
import 'package:flutter_test/flutter_test.dart';
|
||
|
||
void main() {
|
||
group('ChosenPlanModel', () {
|
||
test('создает ChosenPlanModel с правильными значениями', () {
|
||
const plan = PlanModel(
|
||
id: 1,
|
||
slug: 'test-plan',
|
||
name: 'Test Plan',
|
||
image: 'https://example.com/image.jpg',
|
||
duration: 7,
|
||
state: 'active',
|
||
type: PlanType(fit: true, slim: false, behavior: false, wellness: false),
|
||
details: 'Test details',
|
||
packetsCount: 3,
|
||
author: Author(
|
||
authorSlug: 'author',
|
||
authorName: 'Author Name',
|
||
authorProfileIcon: 'https://example.com/icon.jpg',
|
||
authorIsMe: false,
|
||
isEntitySubscribedByMe: null,
|
||
authorPlaceInRating: null,
|
||
),
|
||
totalLikes: 10,
|
||
totalViews: 100,
|
||
totalComments: 5,
|
||
isFavorite: false,
|
||
minPriceOfOptions: 1000,
|
||
maxPriceOfOptions: 2000,
|
||
wasLikedByMe: false,
|
||
);
|
||
|
||
final chosenPlan = ChosenPlanModel(
|
||
id: 1,
|
||
optionType: 'options1',
|
||
startDate: DateTime(2024, 1, 1),
|
||
chosenPlanState: ChosenPlanStateEnum.stateInited,
|
||
chatId: 'chat-1',
|
||
consultantId: 1,
|
||
plan: plan,
|
||
);
|
||
|
||
expect(chosenPlan.id, 1);
|
||
expect(chosenPlan.optionType, 'options1');
|
||
expect(chosenPlan.chosenPlanState, ChosenPlanStateEnum.stateInited);
|
||
expect(chosenPlan.plan.id, 1);
|
||
});
|
||
});
|
||
}
|
||
|