title: How to test methods that deal with SQLite database in android?
body: <p>I have made an application that deals with SQLite database by opening, retrieving data from, and inserting data to it. Now I want to test my methods.</p>
  
  <p>So , I have two classes, one "<code>SQLiteHelper</code>" which extends <code>SQLiteOpenHelper</code> to open,create,and upgrade the database, and the other is a <code>DataSource</code> class, that makes an <code>SQLiteDatabase</code> object,and contains all my methods that deals with the database.</p>
  
  <p>So for calling any method I need to call the open method in the <code>SQLiteHelper</code> class, catch the result in an <code>SQLiteDatabse</code> object,then make an object of the <code>DataSource</code> class,and finally call the method( which contains a cursor as a result of a rawquery for example).</p>
  
  <p>I know that it won't work with simple JUnit test, and I've read about Mock Objects, but I still don't understand how I can use it in my case.</p>