Skip to content

Commit

Permalink
moving test
Browse files Browse the repository at this point in the history
  • Loading branch information
vpandiarajan20 committed Dec 2, 2024
1 parent d46d0bf commit df91fe2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit_test/app/data_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void main() {
final timeSynced = DateTime(2023, 1, 2);
final payload = Struct()..fields.addAll({'key': Value()..stringValue = 'value'});

when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse()
when(serviceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse()
..timeCaptured = Timestamp.fromDateTime(timeCaptured)
..timeSynced = Timestamp.fromDateTime(timeSynced)
..payload = payload));
Expand All @@ -310,12 +310,12 @@ void main() {
expect(response?.$2, equals(timeSynced));
expect(response?.$3, equals({'key': 'value'}));

verify(dataServiceClient.getLatestTabularData(any)).called(1);
verify(serviceClient.getLatestTabularData(any)).called(1);

// Test null response
when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse()));
when(serviceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse()));

final nullResponse = await dataClient.getLatestTabularData('part-id', 'resource-name', 'resource-subtype', 'method-name');
final nullResponse = await serviceClient.getLatestTabularData('part-id', 'resource-name', 'resource-subtype', 'method-name');

expect(nullResponse, isNull);
});
Expand Down

0 comments on commit df91fe2

Please sign in to comment.