Skip to content

Commit 242bef2

Browse files
lint
1 parent cd6d1e8 commit 242bef2

File tree

2 files changed

+10
-26
lines changed

2 files changed

+10
-26
lines changed

lib/src/app/data.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,6 @@ class DataClient {
562562
response.payload.toStruct().toMap(),
563563
);
564564
}
565-
566565
}
567566

568567
/// {@category Viam SDK}

test/unit_test/app/data_client_test.dart

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -411,27 +411,18 @@ void main() {
411411
});
412412
});
413413
});
414-
414+
415415
test('getLatestTabularData', () async {
416416
final timeCaptured = DateTime(2023, 1, 1);
417417
final timeSynced = DateTime(2023, 1, 2);
418-
final payload = Struct()..fields.addAll({
419-
'key': Value()..stringValue = 'value'
420-
});
418+
final payload = Struct()..fields.addAll({'key': Value()..stringValue = 'value'});
421419

422-
when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(
423-
GetLatestTabularDataResponse()
424-
..timeCaptured = Timestamp.fromDateTime(timeCaptured)
425-
..timeSynced = Timestamp.fromDateTime(timeSynced)
426-
..payload = payload
427-
));
420+
when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse()
421+
..timeCaptured = Timestamp.fromDateTime(timeCaptured)
422+
..timeSynced = Timestamp.fromDateTime(timeSynced)
423+
..payload = payload));
428424

429-
final response = await dataClient.getLatestTabularData(
430-
'part-id',
431-
'resource-name',
432-
'resource-subtype',
433-
'method-name'
434-
);
425+
final response = await dataClient.getLatestTabularData('part-id', 'resource-name', 'resource-subtype', 'method-name');
435426

436427
expect(response?.$1, equals(timeCaptured));
437428
expect(response?.$2, equals(timeSynced));
@@ -440,15 +431,9 @@ void main() {
440431
verify(dataServiceClient.getLatestTabularData(any)).called(1);
441432

442433
// Test null response
443-
when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) =>
444-
MockResponseFuture.value(GetLatestTabularDataResponse()));
445-
446-
final nullResponse = await dataClient.getLatestTabularData(
447-
'part-id',
448-
'resource-name',
449-
'resource-subtype',
450-
'method-name'
451-
);
434+
when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse()));
435+
436+
final nullResponse = await dataClient.getLatestTabularData('part-id', 'resource-name', 'resource-subtype', 'method-name');
452437

453438
expect(nullResponse, isNull);
454439
});

0 commit comments

Comments
 (0)