architecture-templates
architecture-templates copied to clipboard
Small fixes in MyModelViewModelTest
As things are currently, the MyModelViewModelTest
gives the impression of being a useful starting point, but ultimately leaves a lot to be desired. It has 2 tests with different names that have the same logic, and as soon as you go to update the second test to do what it says it does, the FakeMyModelRepository
implementation doesn't act as one would reasonably expect (you can call addMyModel
all you want, but still the only thing that was ever emitted was an empty list).
This PR aims to make the class more correct and helpful. Please see individual commits which should be self-explanatory.
Thanks for your PR and thanks for the catch!
Why Unconfined
and not StandardTestDispatcher
?
Good question. If Unconfined
is not the right way to go, I'll fix that and keep that in mind in the future.
Actually, it looks like the tests fail using StandardTestDispatcher
, but it looks like what we should be using is in fact a third thing, UnconfinedTestDispatcher
. @JoseAlcerreca good to merge now?
@JoseAlcerreca any reason not to merge this in?
Sorry, looking into it.
Thanks, approved!
@kworth this needs to be replicated in the multimodule branch as well. Do you want to do it?
Ah, good point. I think I should be able to make time for that. I haven't looked at that branch at all yet. Hopefully it's not too divergent and will be a quick cherry-pick.