Question: Has anyone tried to test databases with roboelectric? I have to pass the context to create the database but I don't know how to inject it!

Thanks!

Answer: 
It wont work easily since the db is on device... and robolectric runs on the jvm mocking all device related stuff out. I would recommend to use Robotium for that instead. 

If you still want to somehow do this with Robolectric you will have to get a sqlite db running and connecting to it on the jvm from the robolectric tests.
<https://groups.google.com/forum/?fromgroups=#!topic/robolectric/gSeC9r5zqr0> 

Good one for testing the content provider with robolectric, but we have to call the content provider queries directly as content resolver wont be there.