Skip to content

Instantly share code, notes, and snippets.

@marcinOz
Created June 14, 2018 11:38
Show Gist options
  • Save marcinOz/2d068c70c308552267f5d08e31c859d4 to your computer and use it in GitHub Desktop.
Save marcinOz/2d068c70c308552267f5d08e31c859d4 to your computer and use it in GitHub Desktop.
@Mock
private lateinit var dataProvider: DataProvider
@Mock lateinit var observer: Observer<ResourceState<List<Movie>>>
private lateinit var viewModel: MovieListViewModel
@Before
fun init() {
MockitoAnnotations.initMocks(this)
viewModel = MovieListViewModel(dataProvider)
.apply { movieDiscover.observeForever(observer) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment