import 'package:flutter_test/flutter_test.dart';
import 'package:rtc_sdk/rtc_sdk.dart';
import 'package:rtc_sdk/rtc_sdk_platform_interface.dart';
import 'package:rtc_sdk/rtc_sdk_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockRtcSdkPlatform
    with MockPlatformInterfaceMixin
    implements RtcSdkPlatform {

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

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

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

  test('getPlatformVersion', () async {
    RtcSdkApi rtcSdkPlugin = RtcSdkApi();
    MockRtcSdkPlatform fakePlatform = MockRtcSdkPlatform();
    RtcSdkPlatform.instance = fakePlatform;

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