30 lines
903 B
Dart
30 lines
903 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:idcard/idcard.dart';
|
|
import 'package:idcard/idcard_platform_interface.dart';
|
|
import 'package:idcard/idcard_method_channel.dart';
|
|
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
|
|
|
|
class MockIdcardPlatform
|
|
with MockPlatformInterfaceMixin
|
|
implements IdcardPlatform {
|
|
|
|
@override
|
|
Future<String?> getPlatformVersion() => Future.value('42');
|
|
}
|
|
|
|
void main() {
|
|
final IdcardPlatform initialPlatform = IdcardPlatform.instance;
|
|
|
|
test('$MethodChannelIdcard is the default instance', () {
|
|
expect(initialPlatform, isInstanceOf<MethodChannelIdcard>());
|
|
});
|
|
|
|
test('getPlatformVersion', () async {
|
|
Idcard idcardPlugin = Idcard();
|
|
MockIdcardPlatform fakePlatform = MockIdcardPlatform();
|
|
IdcardPlatform.instance = fakePlatform;
|
|
|
|
expect(await idcardPlugin.getPlatformVersion(), '42');
|
|
});
|
|
}
|