import 'package:flutter_test/flutter_test.dart'; import 'package:native_vision/native/native_vision.dart'; import 'package:native_vision/native_vision_platform_interface.dart'; import 'package:native_vision/native_vision_method_channel.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; class MockNativeVisionPlatform with MockPlatformInterfaceMixin implements NativeVisionPlatform { @override Future getPlatformVersion() => Future.value('42'); } void main() { final NativeVisionPlatform initialPlatform = NativeVisionPlatform.instance; test('$MethodChannelNativeVision is the default instance', () { expect(initialPlatform, isInstanceOf()); }); test('getPlatformVersion', () async { NativeVision nativeVisionPlugin = NativeVision(); MockNativeVisionPlatform fakePlatform = MockNativeVisionPlatform(); NativeVisionPlatform.instance = fakePlatform; expect(await nativeVisionPlugin.getPlatformVersion(), '42'); }); }