Created
November 20, 2019 17:30
-
-
Save elihart/e3fa08c1c42de0b1e79fff08c4fd3887 to your computer and use it in GitHub Desktop.
MvRx Mock Variant DSL Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun provideMocks() = mockSingleViewModel( | |
viewModelReference = DadJokeFragment::viewModel, | |
defaultState = mockDadJokeState | |
) { | |
state("Loading") { | |
copy(jokes = Loading()) | |
} | |
state("Empty results") { | |
copy(jokes = Success(jokes.copy(results = emptyList()))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment