We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying mock the method channel "biometric_storage", but the mock response does not invoke while executing the test case.
I tried to run the given test case and it failed.
import 'package:biometric_storage/src/biometric_storage.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { const channel = MethodChannel('biometric_storage'); TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { channel.setMockMethodCallHandler((MethodCall methodCall) async { if (methodCall.method == 'canAuthenticate') { return 'ErrorUnknown'; } throw PlatformException(code: 'NotImplemented'); }); }); tearDown(() { channel.setMockMethodCallHandler(null); }); test('canAuthenticate', () async { final result = await BiometricStorage().canAuthenticate(); expect(result, CanAuthenticateResponse.unsupported); }); }
Here, BiometricStorage().canAuthenticate() return "errorHwUnavailable" despite mocking the response.
BiometricStorage().canAuthenticate()
can anyone help me out?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying mock the method channel "biometric_storage", but the mock response does not invoke while executing the test case.
I tried to run the given test case and it failed.
Here,
BiometricStorage().canAuthenticate()
return "errorHwUnavailable" despite mocking the response.can anyone help me out?
The text was updated successfully, but these errors were encountered: