import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:weibo_kit/src/weibo_kit_method_channel.dart'; void main() { final MethodChannelWeiboKit platform = MethodChannelWeiboKit(); const MethodChannel channel = MethodChannel('v7lin.github.io/weibo_kit'); TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { channel.setMockMethodCallHandler((MethodCall methodCall) async { switch (methodCall.method) { case 'isInstalled': return true; } }); }); tearDown(() { channel.setMockMethodCallHandler(null); }); test('isInstalled', () async { expect(await platform.isInstalled(), true); }); }