Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sweep Rules] Add Unit Tests for New Business Logic in Report Service #124

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: Updated test/services/report_service_test.da
sweep-ai[bot] authored Jan 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1691a477f14149c1a6f75d4057c21727677b24ec
9 changes: 3 additions & 6 deletions test/services/report_service_test.dart
Original file line number Diff line number Diff line change
@@ -74,14 +74,11 @@ void main() {
);

test(
'getViolation should return a TrafficViolation when the http call completes successfully',
'getViolation should throw an exception when the http call is unsuccessful',
() async {
const int recordId = 1;
when(client.get(isA<Uri>() as Uri))
.thenAnswer((_) async => http.Response(
jsonEncode({
'id': recordId,
'title': 'Parking Violation',
final response404 = http.Response('', 404);
when(client.get(isA<Uri>())).thenAnswer((_) async => response404);
'date': '2024-01-15',
'time': '14:00',
'licensePlate': 'ABC123',