@@ -411,27 +411,18 @@ void main() {
411
411
});
412
412
});
413
413
});
414
-
414
+
415
415
test ('getLatestTabularData' , () async {
416
416
final timeCaptured = DateTime (2023 , 1 , 1 );
417
417
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' });
421
419
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));
428
424
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' );
435
426
436
427
expect (response? .$1, equals (timeCaptured));
437
428
expect (response? .$2, equals (timeSynced));
@@ -440,15 +431,9 @@ void main() {
440
431
verify (dataServiceClient.getLatestTabularData (any)).called (1 );
441
432
442
433
// 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' );
452
437
453
438
expect (nullResponse, isNull);
454
439
});
0 commit comments