Skip to content

Commit

Permalink
Update Dart mocks and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmorgan committed Apr 21, 2023
1 parent c46ec97 commit 8dbac62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/local_auth/local_auth_android/test/local_auth_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ void main() {

group('getEnrolledBiometrics', () {
test('translates values', () async {
when(api.getEnrolledBiometrics()).thenAnswer((_) async =>
<AuthClassification>[
AuthClassification.weak,
AuthClassification.strong
]);
when(api.getEnrolledBiometrics())
.thenAnswer((_) async => <AuthClassificationWrapper>[
AuthClassificationWrapper(value: AuthClassification.weak),
AuthClassificationWrapper(value: AuthClassification.strong),
]);

final List<BiometricType> result = await plugin.getEnrolledBiometrics();

Expand All @@ -81,7 +81,7 @@ void main() {

test('handles emtpy', () async {
when(api.getEnrolledBiometrics())
.thenAnswer((_) async => <AuthClassification>[]);
.thenAnswer((_) async => <AuthClassificationWrapper>[]);

final List<BiometricType> result = await plugin.getEnrolledBiometrics();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi {
returnValue: _i3.Future<bool>.value(false),
) as _i3.Future<bool>);
@override
_i3.Future<List<_i2.AuthClassification?>> getEnrolledBiometrics() =>
_i3.Future<List<_i2.AuthClassificationWrapper?>> getEnrolledBiometrics() =>
(super.noSuchMethod(
Invocation.method(
#getEnrolledBiometrics,
[],
),
returnValue: _i3.Future<List<_i2.AuthClassification?>>.value(
<_i2.AuthClassification?>[]),
) as _i3.Future<List<_i2.AuthClassification?>>);
returnValue: _i3.Future<List<_i2.AuthClassificationWrapper?>>.value(
<_i2.AuthClassificationWrapper?>[]),
) as _i3.Future<List<_i2.AuthClassificationWrapper?>>);
@override
_i3.Future<_i2.AuthResultWrapper> authenticate(
_i2.AuthOptions? arg_options,
Expand Down

0 comments on commit 8dbac62

Please sign in to comment.