FakeAuthDataSource

class FakeAuthDataSource(initialUser: AuthUser? = null) : AuthDataSource(source)

In-memory AuthDataSource for tests, so repository tests do not need Firebase.

The signInWith* methods take an Activity, which a unit test has no way to produce. They are left unimplemented on purpose: a test that reaches one is testing something that belongs in an instrumented test, and failing loudly says so.

Parameters

initialUser

The signed-in user, or null for signed out.

Constructors

Link copied to clipboard
constructor(initialUser: AuthUser? = null)

Properties

Link copied to clipboard

How many times signOut has been called.

Link copied to clipboard

Set to have signOut fail, for testing the error path of a repository.

Functions

Link copied to clipboard
open override fun getCurrentUser(): AuthUser?
Link copied to clipboard
open suspend override fun registerWithEmailAndPassword(name: String, email: String, password: String, activity: Activity): AuthUser
Link copied to clipboard
open suspend override fun registerWithGoogle(activity: Activity): AuthUser
Link copied to clipboard
open suspend override fun signInWithEmailAndPassword(email: String, password: String): AuthUser
Link copied to clipboard
open suspend override fun signInWithGoogle(activity: Activity): AuthUser
Link copied to clipboard
open suspend override fun signInWithSavedCredentials(activity: Activity): AuthUser
Link copied to clipboard
open suspend override fun signOut()