test(tests): add comprehensive unit tests for various models and repositories, enhancing test coverage and ensuring correct functionality

This commit is contained in:
mso7nueh
2025-12-09 16:19:48 +03:00
parent edd064d20d
commit 70e4a42e98
25 changed files with 2565 additions and 58 deletions

View File

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