-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Unit tests/basics #28
New issue
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
base: develop
Are you sure you want to change the base?
Conversation
catadarjan-tapptitude
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice :D
- with just some small comments
| class LoadImageUseCase internal constructor(private val imageRepository: ImageRepository) { | ||
| class LoadImageUseCase constructor(private val imageRepository: ImageRepository) { | ||
|
|
||
| suspend fun invoke(): Image = imageRepository.getRandomImage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it also have the operator modifier? 🤔
| ) : ViewModel() { | ||
| private val _isLoading = MutableLiveData<Boolean>() | ||
| private val _isLoading = MutableLiveData<Boolean>(false) | ||
| val isLoading: LiveData<Boolean> = _isLoading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is supposed to have a getter instead of assigned MutableLiveData value, right?
| import kotlinx.coroutines.flow.StateFlow | ||
|
|
||
| internal class FakeSessionManager : SessionManager { | ||
| private val _currentLoginStateFlow: MutableStateFlow<LoginState> = MutableStateFlow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the Hard Wrap setting value in your Android Studio? I think anything under ~120 is a bit too short
| * No need to create an instance of retrofit | ||
| */ | ||
| internal class SessionInterceptorTest { | ||
| private lateinit var interceptor: SessionInterceptor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer leaving an empty line between class declaration and first field/method. Makes it feel a bit cleaner :D
A a few Unit Test