forked from eatvio/eatvio_app
chore(version): update app version to 1.3.5+85 and improve test coverage reporting in CI
This commit is contained in:
@@ -3,27 +3,28 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('CancelationModel', () {
|
||||
test('создает CancelationModel с правильными значениями', () {
|
||||
final model = CancelationModel(
|
||||
description: 'Test reason',
|
||||
price: 1000,
|
||||
);
|
||||
test('создает экземпляр с description и price', () {
|
||||
final model = CancelationModel(description: 'Test reason', price: 1000);
|
||||
|
||||
expect(model.description, 'Test reason');
|
||||
expect(model.price, 1000);
|
||||
});
|
||||
|
||||
test('fromJson создает CancelationModel из JSON', () {
|
||||
final json = {
|
||||
'description': 'Test reason',
|
||||
'price': 1000,
|
||||
};
|
||||
test('fromJson создает модель из JSON', () {
|
||||
final json = {'description': 'Test reason', 'price': 1000};
|
||||
|
||||
final model = CancelationModel.fromJson(json);
|
||||
|
||||
expect(model.description, 'Test reason');
|
||||
expect(model.price, 1000);
|
||||
});
|
||||
|
||||
test('toJson преобразует модель в JSON', () {
|
||||
final model = CancelationModel(description: 'Test reason', price: 1000);
|
||||
final json = model.toJson();
|
||||
|
||||
expect(json['description'], 'Test reason');
|
||||
expect(json['price'], 1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user