@@ -9,10 +9,12 @@ import 'package:flutter/widgets.dart' as widgets;
9
9
import 'package:flutter_test/flutter_test.dart' ;
10
10
import 'package:in_app_purchase_android/billing_client_wrappers.dart' ;
11
11
import 'package:in_app_purchase_android/in_app_purchase_android.dart' ;
12
+ import 'package:in_app_purchase_android/src/billing_client_wrappers/billing_config_wrapper.dart' ;
12
13
import 'package:in_app_purchase_android/src/messages.g.dart' ;
13
14
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart' ;
14
15
import 'package:mockito/mockito.dart' ;
15
16
17
+ import 'billing_client_wrappers/billing_client_wrapper_test.dart' ;
16
18
import 'billing_client_wrappers/billing_client_wrapper_test.mocks.dart' ;
17
19
import 'billing_client_wrappers/product_details_wrapper_test.dart' ;
18
20
import 'billing_client_wrappers/purchase_wrapper_test.dart' ;
@@ -747,4 +749,20 @@ void main() {
747
749
expect (await completer.future, equals (expectedBillingResult));
748
750
});
749
751
});
752
+
753
+ group ('billingConfig' , () {
754
+ test ('getCountryCode success' , () async {
755
+ const String expectedCountryCode = 'US' ;
756
+ const BillingConfigWrapper expected = BillingConfigWrapper (
757
+ countryCode: expectedCountryCode,
758
+ responseCode: BillingResponse .ok,
759
+ debugMessage: 'dummy message' );
760
+
761
+ when (mockApi.getBillingConfigAsync ())
762
+ .thenAnswer ((_) async => platformBillingConfigFromWrapper (expected));
763
+ final String countryCode = await iapAndroidPlatform.getCountryCode ();
764
+
765
+ expect (countryCode, equals (expectedCountryCode));
766
+ });
767
+ });
750
768
}
0 commit comments