I have to build an app with sqlite usage. Now I want to write my unit tests. These unit tests should test my class SQLiteBridge
. SQLiteBridge
provides DAOs for every child class of Model.
Now I got the problem that I need a context to create my SQLiteBridge
. SQLiteBridge
creates and handles a SQLite database on the system..
Where to get the Context-Object from?
My setup is like here (so I'm using Junit4 [thanks god]):
http://tools.android.com/tech-docs/unit-testing-support
EDIT: I hope there is a way like the old AndroidTestCase
to extend without losing Junit4. :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…