12345678910111213141516171819202122232425262728293031 |
- import 'package:flutter_test/flutter_test.dart';
- import 'package:flutter_smartscan_plugin/flutter_smartscan_plugin.dart';
- import 'package:flutter_smartscan_plugin/flutter_smartscan_plugin_platform_interface.dart';
- import 'package:flutter_smartscan_plugin/plugin_method_channel_native.dart';
- import 'package:plugin_platform_interface/plugin_platform_interface.dart';
- class MockFlutterSmartscanPluginPlatform
- with MockPlatformInterfaceMixin
- implements FlutterSmartscanPluginPlatform {
- @override
- Future<String?> getPlatformVersion() => Future.value('42');
- }
- void main() {
- final FlutterSmartscanPluginPlatform initialPlatform =
- FlutterSmartscanPluginPlatform.instance;
- test('$MethodChannelFlutterSmartscanPlugin is the default instance', () {
- expect(
- initialPlatform, isInstanceOf<MethodChannelFlutterSmartscanPlugin>());
- });
- test('getPlatformVersion', () async {
- FlutterSmartscanPlugin flutterSmartscanPlugin = FlutterSmartscanPlugin();
- MockFlutterSmartscanPluginPlatform fakePlatform =
- MockFlutterSmartscanPluginPlatform();
- FlutterSmartscanPluginPlatform.instance = fakePlatform;
- expect(await flutterSmartscanPlugin.getPlatformVersion(), '42');
- });
- }
|