import 'package:flutter_test/flutter_test.dart';
import 'package:l10n_sdk/l10n_sdk.dart';
import 'package:l10n_sdk/l10n_sdk_platform_interface.dart';
import 'package:l10n_sdk/l10n_sdk_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockL10nSdkPlatform
    with MockPlatformInterfaceMixin
    implements L10nSdkPlatform {

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

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

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

  test('getPlatformVersion', () async {
    L10nSdkApi l10nSdkPlugin = L10nSdkApi();
    MockL10nSdkPlatform fakePlatform = MockL10nSdkPlatform();
    L10nSdkPlatform.instance = fakePlatform;

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