import 'package:flutter_test/flutter_test.dart';
import 'package:protocol_sdk/protocol_sdk.dart';
import 'package:protocol_sdk/protocol_sdk_platform_interface.dart';
import 'package:protocol_sdk/protocol_sdk_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockProtocolSdkPlatform
    with MockPlatformInterfaceMixin
    implements ProtocolSdkPlatform {

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

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

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

  test('getPlatformVersion', () async {
    ProtocolSdkApi protocolSdkPlugin = ProtocolSdkApi();
    MockProtocolSdkPlatform fakePlatform = MockProtocolSdkPlatform();
    ProtocolSdkPlatform.instance = fakePlatform;

    expect(await protocolSdkPlugin.platformVersion(), '42');
  });
}
