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:
55
test/features/recipe/models/my_recipe_model_test.dart
Normal file
55
test/features/recipe/models/my_recipe_model_test.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'package:eatvio_app/features/recipe/models/my_recipe_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('MyRecipeModel', () {
|
||||
test('создает MyRecipeModel с правильными значениями', () {
|
||||
const model = MyRecipeModel(
|
||||
id: 1,
|
||||
image: 'https://example.com/image.jpg',
|
||||
state: 'active',
|
||||
cookingTime: 30,
|
||||
activeCookingTime: 15,
|
||||
description: 'Test description',
|
||||
steps: null,
|
||||
videoUrl: null,
|
||||
title: 'Test Recipe',
|
||||
slug: 'test-recipe',
|
||||
calories: 300.0,
|
||||
likesCount: 10,
|
||||
viewsCount: 100,
|
||||
);
|
||||
|
||||
expect(model.id, 1);
|
||||
expect(model.title, 'Test Recipe');
|
||||
expect(model.slug, 'test-recipe');
|
||||
expect(model.calories, 300.0);
|
||||
});
|
||||
});
|
||||
|
||||
group('MyRecipePaginationModel', () {
|
||||
test('создает MyRecipePaginationModel с правильными значениями', () {
|
||||
const recipe = MyRecipeModel(
|
||||
id: 1,
|
||||
image: 'https://example.com/image.jpg',
|
||||
state: 'active',
|
||||
cookingTime: 30,
|
||||
activeCookingTime: 15,
|
||||
description: 'Test description',
|
||||
steps: null,
|
||||
videoUrl: null,
|
||||
title: 'Test Recipe',
|
||||
slug: 'test-recipe',
|
||||
calories: 300.0,
|
||||
likesCount: 10,
|
||||
viewsCount: 100,
|
||||
);
|
||||
|
||||
const pagination = MyRecipePaginationModel(data: [recipe]);
|
||||
|
||||
expect(pagination.data.length, 1);
|
||||
expect(pagination.data.first.id, 1);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user