Skip to content
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

Questions on unit tests #183

Closed
cxzhang2 opened this issue Jun 17, 2016 · 2 comments
Closed

Questions on unit tests #183

cxzhang2 opened this issue Jun 17, 2016 · 2 comments

Comments

@cxzhang2
Copy link

  1. Is the hashcode_equals_shouldWorkCorrectly test necessary due to AutoValue?
  2. Looks like we have RunWIth(QualityMattersRobolectricUnitTestRunner.class) in lots of places where Robolectric isn't used? DeveloperSettingsTest may be the only class that actually takes advantage of Robolectric, can we remove Robolectric entirely by mocking SharedPrefs in that class?
@vanniktech
Copy link
Contributor

  1. Not 100% sure - though this is not necessary however it does not hurt to have those tests. Could also be that with an update of AutoValue there's a bug (unlikely since they test their lib too) but then the regression would be detected by the CI and you won't have to bother later finding the problem.
  2. You need Robolectric when you reference to the Android SDK (basically every import that starts with android). Yup mocked sharedprefs is something we want which is also discussed in Unit tests for DeveloperSettings should use mock of SharedPreferences #53

@cxzhang2
Copy link
Author

Ah, my mistake on the Robolectric point. Thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants