I have been googling around but don't seem to be a...
# android
d
I have been googling around but don't seem to be able to get this working, I am writing a unit test for my ViewModel, and am trying to set a MutableLiveData<String> var in my ViewModel, via the test, however the value is never actually set, and the logic I want to test depends on this value not been null. In my test I am using:
Copy code
@get:Rule
    var rule = InstantTaskExecutorRule()
Any idea what else I may be missing?
p
what’s your assertion?
d
Actually it turns out that I needed to
viewmodel.mutabledata.value = "xxx"
and not
viewmodel.mutabledata.postValue("xxx")