mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-06-11 03:40:40 +08:00
34 lines
924 B
Dart
34 lines
924 B
Dart
import 'package:flutter/services.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:tencent_kit/src/tencent_kit_method_channel.dart';
|
|
|
|
void main() {
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
final MethodChannelTencentKit platform = MethodChannelTencentKit();
|
|
const MethodChannel channel = MethodChannel('v7lin.github.io/tencent_kit');
|
|
|
|
setUp(() {
|
|
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
|
.setMockMethodCallHandler(
|
|
channel,
|
|
(MethodCall methodCall) async {
|
|
switch (methodCall.method) {
|
|
case 'isQQInstalled':
|
|
return true;
|
|
}
|
|
return null;
|
|
},
|
|
);
|
|
});
|
|
|
|
tearDown(() {
|
|
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
|
.setMockMethodCallHandler(channel, null);
|
|
});
|
|
|
|
test('isQQInstalled', () async {
|
|
expect(await platform.isQQInstalled(), true);
|
|
});
|
|
}
|