-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add examples of tests using mocking with MockK #197
Comments
Hi @albendz I am interested in this issue! |
@andrewtavis Could you take a look at assigning this to @KesharwaniArpita ? |
Thanks for the ping, @albendz :) @KesharwaniArpita, could we ask you to send along a plan for this issue and we'll give you the ok to implement it? Please let us know if you need some support :) |
HI @albendz @andrewtavis do you think if we should consider writing tests for the |
Yes, It sounds good to me. You could write tests for the Main Activity as an example. |
Terms
Description
Summary
The Scribe Android app supports unit testing with JUnit and mocking with MockK. Right now there aren't any test examples using mocking.
Add an example test that uses mocking.
Note that this may require some refactoring if you find you can't mock certain things or you're mocking a lot. For example, you cannot mock getting environment variables so that can be extracted into a separate class that itself can be mocked. I encountered this issue when I was attempting to write a unit test for one of the Activity classes.
Additional details
Here are some details related to mocking for Android: https://developer.android.com/training/testing/local-tests#mocking-dependencies
MockK documentation: https://mockk.io/
Contribution
I can pick this up later if no one else gets to it before I'm free
The text was updated successfully, but these errors were encountered: