@@ -71,6 +71,25 @@ void main() {
71
71
debugDefaultTargetPlatformOverride = null ;
72
72
});
73
73
74
+ test (
75
+ 'Should receive false when availability is null' ,
76
+ () async {
77
+ const availability = null ;
78
+
79
+ MethodChannelMock (
80
+ channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
81
+ method: 'makeGooglePlayServicesAvailable' ,
82
+ result: availability,
83
+ );
84
+
85
+ final googlePlayServiceAvailability =
86
+ await const GoogleApiAvailability .private ()
87
+ .makeGooglePlayServicesAvailable ();
88
+
89
+ expect (googlePlayServiceAvailability,
90
+ false );
91
+ });
92
+
74
93
test (
75
94
'Should receive true when device is able to set Google Play Services to available' ,
76
95
() async {
@@ -104,6 +123,25 @@ void main() {
104
123
debugDefaultTargetPlatformOverride = null ;
105
124
});
106
125
126
+ test (
127
+ 'Should receive "ErrorString is null" when availability is null' ,
128
+ () async {
129
+ const errorString = null ;
130
+
131
+ MethodChannelMock (
132
+ channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
133
+ method: 'getErrorString' ,
134
+ result: errorString,
135
+ );
136
+
137
+ final errorStringResult =
138
+ await const GoogleApiAvailability .private ()
139
+ .getErrorString ();
140
+
141
+ expect (errorStringResult,
142
+ "ErrorString is null" );
143
+ });
144
+
107
145
test ('Should receive SUCCESS when connection status is success' , () async {
108
146
MethodChannelMock (
109
147
channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
@@ -130,6 +168,25 @@ void main() {
130
168
debugDefaultTargetPlatformOverride = null ;
131
169
});
132
170
171
+ test (
172
+ 'Should receive false when isUserResolvable is null' ,
173
+ () async {
174
+ const isUserResolvable = null ;
175
+
176
+ MethodChannelMock (
177
+ channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
178
+ method: 'isUserResolvable' ,
179
+ result: isUserResolvable,
180
+ );
181
+
182
+ final isUserResolvableResult =
183
+ await const GoogleApiAvailability .private ()
184
+ .isUserResolvable ();
185
+
186
+ expect (isUserResolvableResult,
187
+ false );
188
+ });
189
+
133
190
test ('Should receive true when error is user resolvable' , () async {
134
191
MethodChannelMock (
135
192
channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
@@ -156,6 +213,25 @@ void main() {
156
213
debugDefaultTargetPlatformOverride = null ;
157
214
});
158
215
216
+ test (
217
+ 'Should receive false when showErrorNotification is null' ,
218
+ () async {
219
+ const showErrorNotification = null ;
220
+
221
+ MethodChannelMock (
222
+ channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
223
+ method: 'showErrorNotification' ,
224
+ result: showErrorNotification,
225
+ );
226
+
227
+ final showErrorNotificationResult =
228
+ await const GoogleApiAvailability .private ()
229
+ .showErrorNotification ();
230
+
231
+ expect (showErrorNotificationResult,
232
+ false );
233
+ });
234
+
159
235
test ('Should receive true when notification is shown' , () async {
160
236
MethodChannelMock (
161
237
channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
0 commit comments