Skip to content

Conversation

@hdralexandru
Copy link

A a few Unit Test

@hdralexandru hdralexandru marked this pull request as draft January 30, 2023 09:31
Copy link

@catadarjan-tapptitude catadarjan-tapptitude left a 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()

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

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(

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants