how do I create a UserCredential Object when testing?
I am trying to test my authRepository like this :
test('', () async {
when(
() => mockFirebaseAuth.createUserWithEmailAndPassword(
email: 'test@test.de', password: '123456'),
).thenAnswer((realInvocation) => ) // I need to return a Future<UserCredential> here);
final result = await authRepository.signUpWithEmailAndPassword(
email: 'test@test.de', password: '123456');
});
but in order to stub createUserWithEmailAndPassword I need to return a
Future<UserCredential>
How do I create such an object?