native_vision_method_channel_test.dart 639 B

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