flutter_smartscan_plugin_method_channel_test.dart 687 B

12345678910111213141516171819202122232425
  1. import 'package:flutter/services.dart';
  2. import 'package:flutter_test/flutter_test.dart';
  3. import 'package:flutter_smartscan_plugin/plugin_method_channel_native.dart';
  4. void main() {
  5. MethodChannelFlutterSmartscanPlugin platform =
  6. MethodChannelFlutterSmartscanPlugin();
  7. const MethodChannel channel = MethodChannel('flutter_smartscan_plugin');
  8. TestWidgetsFlutterBinding.ensureInitialized();
  9. setUp(() {
  10. channel.setMockMethodCallHandler((MethodCall methodCall) async {
  11. return '42';
  12. });
  13. });
  14. tearDown(() {
  15. channel.setMockMethodCallHandler(null);
  16. });
  17. test('getPlatformVersion', () async {
  18. expect(await platform.getPlatformVersion(), '42');
  19. });
  20. }