-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlua_flutter_test.dart
29 lines (23 loc) · 1014 Bytes
/
lua_flutter_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import 'package:flutter_test/flutter_test.dart';
import 'package:lua_flutter/lua_flutter.dart';
import 'package:lua_flutter/lua_flutter_platform_interface.dart';
import 'package:lua_flutter/lua_flutter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
class MockLuaFlutterPlatform
with MockPlatformInterfaceMixin
implements LuaFlutterPlatform {
@override
Future<String?> getPlatformVersion() => Future.value('42');
}
void main() {
final LuaFlutterPlatform initialPlatform = LuaFlutterPlatform.instance;
test('$MethodChannelLuaFlutter is the default instance', () {
expect(initialPlatform, isInstanceOf<MethodChannelLuaFlutter>());
});
test('getPlatformVersion', () async {
LuaFlutter luaFlutterPlugin = LuaFlutter();
MockLuaFlutterPlatform fakePlatform = MockLuaFlutterPlatform();
LuaFlutterPlatform.instance = fakePlatform;
expect(await luaFlutterPlugin.getPlatformVersion(), '42');
});
}