forked from eatvio/eatvio_app
test(tests): add comprehensive unit tests for various models and repositories, enhancing test coverage and ensuring correct functionality
This commit is contained in:
@@ -6,22 +6,39 @@ void main() {
|
||||
test('создает Step с правильными значениями', () {
|
||||
const step = Step(
|
||||
image: 'https://example.com/image.jpg',
|
||||
description: 'Step description',
|
||||
description: 'Test step description',
|
||||
);
|
||||
|
||||
expect(step.image, 'https://example.com/image.jpg');
|
||||
expect(step.description, 'Step description');
|
||||
expect(step.description, 'Test step description');
|
||||
});
|
||||
|
||||
test('создает Step с null значениями', () {
|
||||
const step = Step(
|
||||
image: null,
|
||||
description: null,
|
||||
);
|
||||
const step = Step();
|
||||
|
||||
expect(step.image, isNull);
|
||||
expect(step.description, isNull);
|
||||
});
|
||||
|
||||
test('fromJson создает Step из JSON', () {
|
||||
final json = {
|
||||
'image': 'https://example.com/image.jpg',
|
||||
'description': 'Test step description',
|
||||
};
|
||||
|
||||
final step = Step.fromJson(json);
|
||||
|
||||
expect(step.image, 'https://example.com/image.jpg');
|
||||
expect(step.description, 'Test step description');
|
||||
});
|
||||
|
||||
test('fromJson создает Step из JSON с null значениями', () {
|
||||
final json = <String, dynamic>{};
|
||||
|
||||
final step = Step.fromJson(json);
|
||||
|
||||
expect(step.image, isNull);
|
||||
expect(step.description, isNull);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user