cake_wallet/cw_mweb/test/cw_mweb_method_channel_test.dart

28 lines
766 B
Dart
Raw Normal View History

2024-04-20 23:20:52 +00:00
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:cw_mweb/cw_mweb_method_channel.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
MethodChannelCwMweb platform = MethodChannelCwMweb();
const MethodChannel channel = MethodChannel('cw_mweb');
setUp(() {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(
channel,
(MethodCall methodCall) async {
return '42';
},
);
});
tearDown(() {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null);
});
test('getPlatformVersion', () async {
expect(await platform.getPlatformVersion(), '42');
});
}