I am new to junit testing.
Can anyone help me , how to test my SQLiteOpenHelper class.
Means what classes I have to implement and how to test my db and tables.
I am using Eclipse IDE.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As of API Level 24,
RenamingDelegatingContextis deprecated. Another thread suggests to use Robolectric‘sRuntimeEnvironment.applicationas described in this Medium article.The old answer for reference:
For a simple DatabaseHandler:
I created an AndroidTestCase: