import 'package:flutter_test/flutter_test.dart';
import 'package:max_yandex_adapter/max_yandex_adapter.dart';
import 'package:max_yandex_adapter/max_yandex_adapter_platform_interface.dart';
import 'package:max_yandex_adapter/max_yandex_adapter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMaxYandexAdapterPlatform
    with MockPlatformInterfaceMixin
    implements MaxYandexAdapterPlatform {

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

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

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

  test('getPlatformVersion', () async {
    MaxYandexAdapter maxYandexAdapterPlugin = MaxYandexAdapter();
    MockMaxYandexAdapterPlatform fakePlatform = MockMaxYandexAdapterPlatform();
    MaxYandexAdapterPlatform.instance = fakePlatform;

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