From fcd43eb2e486d20e7a3f5c260b026abc5416cc18 Mon Sep 17 00:00:00 2001 From: Satyam Jha Date: Thu, 26 Dec 2024 21:52:34 +0530 Subject: [PATCH] covered all test cases 4 --- .../connectivity_service_test.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/service_tests/third_party_service_test.dart/connectivity_service_test.dart b/test/service_tests/third_party_service_test.dart/connectivity_service_test.dart index f793f45d6..315950452 100644 --- a/test/service_tests/third_party_service_test.dart/connectivity_service_test.dart +++ b/test/service_tests/third_party_service_test.dart/connectivity_service_test.dart @@ -147,6 +147,22 @@ void main() { mockConnectivity._controller.addError(Exception("Something went wrong!")); }); + test('connectivity stream callback handles List', + () async { + final service = ConnectivityService(); + await service.initConnectivity(client: mockClient); + + void callback(List 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];