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