import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_zsdk/flutter_zsdk.dart';
import 'package:flutter_zsdk/src/flutter_zsdk_platform_interface.dart';
import 'package:flutter_zsdk/src/flutter_zsdk_method_channel.dart';
import 'package:flutter_zsdk/src/models/bluetooth_printer.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterZsdkPlatform
    with MockPlatformInterfaceMixin
    implements FlutterZsdkPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<List<BluetoothPrinter>> findBluetoothPrinters() => Future.value([]);
}

void main() {
  final FlutterZsdkPlatform initialPlatform = FlutterZsdkPlatform.instance;

  test('$MethodChannelFlutterZsdk is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterZsdk>());
  });

  test('getPlatformVersion', () async {
    FlutterZsdk flutterZsdkPlugin = FlutterZsdk();
    MockFlutterZsdkPlatform fakePlatform = MockFlutterZsdkPlatform();
    FlutterZsdkPlatform.instance = fakePlatform;

    expect(await flutterZsdkPlugin.getPlatformVersion(), '42');
  });
}
