Skip to content

Commit

Permalink
covered all test cases 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Satyam Jha committed Dec 26, 2024
1 parent 814e8e2 commit fcd43eb
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ void main() {
mockConnectivity._controller.addError(Exception("Something went wrong!"));
});

test('connectivity stream callback handles List<ConnectivityResult>',
() async {
final service = ConnectivityService();
await service.initConnectivity(client: mockClient);

void callback(List<ConnectivityResult> result) {
service.connectionStatusController.add(result);
}

final testResults = [ConnectivityResult.wifi];
callback(testResults);

final emittedResults = await service.connectionStream.first;
expect(emittedResults, equals(testResults));
});

test('enableSubscription with actual service', () async {
final testResults = [ConnectivityResult.wifi];

Expand Down

0 comments on commit fcd43eb

Please sign in to comment.