runable
This commit is contained in:
37
test/simple_test.dart
Normal file
37
test/simple_test.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:minhthu/features/scanner/data/models/scan_item.dart';
|
||||
import 'package:minhthu/features/scanner/data/models/save_request_model.dart';
|
||||
import 'package:minhthu/features/scanner/domain/entities/scan_entity.dart';
|
||||
|
||||
void main() {
|
||||
group('Simple Tests', () {
|
||||
test('ScanEntity should be created with valid data', () {
|
||||
final entity = ScanEntity(
|
||||
barcode: '123456789',
|
||||
timestamp: DateTime.now(),
|
||||
field1: 'Value1',
|
||||
field2: 'Value2',
|
||||
field3: 'Value3',
|
||||
field4: 'Value4',
|
||||
);
|
||||
|
||||
expect(entity.barcode, '123456789');
|
||||
expect(entity.field1, 'Value1');
|
||||
expect(entity.isFormComplete, true);
|
||||
});
|
||||
|
||||
test('SaveRequestModel should serialize to JSON', () {
|
||||
final request = SaveRequestModel(
|
||||
barcode: '111222333',
|
||||
field1: 'Data1',
|
||||
field2: 'Data2',
|
||||
field3: 'Data3',
|
||||
field4: 'Data4',
|
||||
);
|
||||
|
||||
final json = request.toJson();
|
||||
expect(json['barcode'], '111222333');
|
||||
expect(json['field1'], 'Data1');
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user