weibo_kit/test/weibo_kit_method_channel_test.dart
2022-05-19 16:12:25 +08:00

28 lines
706 B
Dart

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);
});
}