Wouldn't it be simpler to just use LiveData<T>.value in the com.example.android.kotlincoroutines.main.MainViewModelTest#whenMainClicked_updatesTaps unit test?
getValueForTest() seems a convoluted way to get to the same place. I understand it might be different in some circumstances, but not in this test.
I also prefer to statically import assertThat so the test is less polluted, but that is a matter of taste, of course. And it is true that the presence of the Truth class there, was important for me to know where the method was coming from.
Wouldn't it be simpler to just use
LiveData<T>.value
in thecom.example.android.kotlincoroutines.main.MainViewModelTest#whenMainClicked_updatesTaps
unit test?getValueForTest()
seems a convoluted way to get to the same place. I understand it might be different in some circumstances, but not in this test.I implemented it like so:
I also prefer to statically import
assertThat
so the test is less polluted, but that is a matter of taste, of course. And it is true that the presence of theTruth
class there, was important for me to know where the method was coming from.