2023-10-20 13:49:23 +08:00
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:jc_printer/jc_printer.dart';
|
|
|
|
import 'package:jc_printer/jc_printer_platform_interface.dart';
|
|
|
|
import 'package:jc_printer/jc_printer_method_channel.dart';
|
2023-10-20 17:45:24 +08:00
|
|
|
// import 'package:plugin_platform_interface/plugin_platform_interface.dart';
|
2023-10-20 13:49:23 +08:00
|
|
|
|
2023-10-20 17:45:24 +08:00
|
|
|
/*class MockJcPrinterPlatform
|
2023-10-20 13:49:23 +08:00
|
|
|
with MockPlatformInterfaceMixin
|
|
|
|
implements JcPrinterPlatform {
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<String?> getPlatformVersion() => Future.value('42');
|
2023-10-20 17:45:24 +08:00
|
|
|
}*/
|
2023-10-20 13:49:23 +08:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
final JcPrinterPlatform initialPlatform = JcPrinterPlatform.instance;
|
|
|
|
|
|
|
|
test('$MethodChannelJcPrinter is the default instance', () {
|
|
|
|
expect(initialPlatform, isInstanceOf<MethodChannelJcPrinter>());
|
|
|
|
});
|
|
|
|
|
|
|
|
test('getPlatformVersion', () async {
|
|
|
|
JcPrinter jcPrinterPlugin = JcPrinter();
|
2023-10-20 17:45:24 +08:00
|
|
|
// MockJcPrinterPlatform fakePlatform = MockJcPrinterPlatform();
|
|
|
|
// JcPrinterPlatform.instance = fakePlatform;
|
2023-10-20 13:49:23 +08:00
|
|
|
|
|
|
|
expect(await jcPrinterPlugin.getPlatformVersion(), '42');
|
|
|
|
});
|
|
|
|
}
|