import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_paid/flutter_paid.dart';
import 'package:flutter_paid/flutter_paid_platform_interface.dart';
import 'package:flutter_paid/flutter_paid_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterPaidPlatform
    with MockPlatformInterfaceMixin
    implements FlutterPaidPlatform {

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

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

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

  test('getPlatformVersion', () async {
    FlutterPaid flutterPaidPlugin = FlutterPaid();
    MockFlutterPaidPlatform fakePlatform = MockFlutterPaidPlatform();
    FlutterPaidPlatform.instance = fakePlatform;

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