import 'package:flutter_test/flutter_test.dart';
import 'package:liblinphone_flutter/liblinphone_flutter.dart';
import 'package:liblinphone_flutter/liblinphone_flutter_platform_interface.dart';
import 'package:liblinphone_flutter/liblinphone_flutter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockLiblinphoneFlutterPlatform
    with MockPlatformInterfaceMixin
    implements LiblinphoneFlutterPlatform {

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

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

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

  test('getPlatformVersion', () async {
    LiblinphoneFlutter liblinphoneFlutterPlugin = LiblinphoneFlutter();
    MockLiblinphoneFlutterPlatform fakePlatform = MockLiblinphoneFlutterPlatform();
    LiblinphoneFlutterPlatform.instance = fakePlatform;

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