-
Notifications
You must be signed in to change notification settings - Fork 922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViewModel tests are always successful #27
Comments
If you set a breakpoint inside the block of A solution might be spy import org.mockito.Mockito.mock
import org.mockito.Mockito.spy
private val getMovies = spy(GetMovies(mock(MoviesRepository::class.java))) |
Good catch! @JavierSA have you tried that out? If so, I would appreciate a PR. Thanks! |
@JavierSA - Unfortunately, in my project, UseCases cannot be run (due to networking dependencies) so, I had to mock the UseCases. My PR presents an alternate solution. |
@fowlerwill I think yours is better, so I've closed my PR. |
Thanks everyone for the contribution! I will review those PRs asap. ❤️ |
Assertions made inside the observeForever block are always successful, even when they shouldn't.
For example in MoviesViewModelTest, if i say that the first element poster is equals to "IronMannnn", it will pass, even if the real value is "IronMan".
The text was updated successfully, but these errors were encountered: