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

Implement Storage that will wrap Realm #32

Closed
abdrasulov opened this issue Sep 19, 2018 · 1 comment
Closed

Implement Storage that will wrap Realm #32

abdrasulov opened this issue Sep 19, 2018 · 1 comment
Labels
enhancement New feature or request
Projects

Comments

@abdrasulov
Copy link
Member

abdrasulov commented Sep 19, 2018

The Issue

Using Realm directly makes harder to write automated tests. The current solution with Realm in memory requires appContext to run tests. That is why we have to write unit test as android Instrumented test. I've came to that instrumented tests are good for UI testing, not for unit testing. We cannot use tools like Powermock there. In addition assertion blocks in tests look complicated.

Solution

Add a new class (singleton?) Storage. Realm clients will use this object instead of Realm. It will have concrete methods for retrieving and storing objects. As a result the current realm clients will dependent on Storage object. We can mock Storage without any problem in unit tests without appContext. So we will be able to write simple unit tests.

@abdrasulov abdrasulov added the enhancement New feature or request label Sep 19, 2018
@abdrasulov abdrasulov added this to To do in 0.3.0 via automation Feb 27, 2019
@abdrasulov
Copy link
Member Author

This issue is no longer relevant since Realm has been replaced with Room

0.3.0 automation moved this from To do to Done Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
0.3.0
  
Done
Development

No branches or pull requests

1 participant