File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ void main() {
34
34
license_plate: 'ABC123' ,
35
35
violation: '紅線停車' ,
36
36
status: 'Pending' ,
37
+ address: 'Main St and 1st Ave' ,
38
+ officer: 'Officer123' ,
39
+ mediaFiles: [], // Assuming no media files for simplicity
37
40
address: 'Main St and 1st Ave' ,
38
41
officer: 'Officer123' ,
39
42
mediaFiles: [], // Assuming no media files for simplicity
@@ -66,19 +69,16 @@ void main() {
66
69
]),
67
70
200 ));
68
71
69
- expect (await service.getReports (), isA < List < TrafficViolation >>() );
72
+ expect (await service.getReports (), equals ( < TrafficViolation > [] );
70
73
},
71
74
);
72
75
73
76
test (
74
- 'getViolation should return a TrafficViolation when the http call completes successfully ' ,
77
+ 'getViolation should throw an exception when the http call is unsuccessful ' ,
75
78
() async {
76
79
const int recordId = 1 ;
77
- when (client.get (isA <Uri >() as Uri ))
78
- .thenAnswer ((_) async => http.Response (
79
- jsonEncode ({
80
- 'id' : recordId,
81
- 'title' : 'Parking Violation' ,
80
+ final response404 = http.Response ('' , 404 );
81
+ when (client.get (isA <Uri >())).thenAnswer ((_) async => response404);
82
82
'date' : '2024-01-15' ,
83
83
'time' : '14:00' ,
84
84
'licensePlate' : 'ABC123' ,
You can’t perform that action at this time.
0 commit comments